增加把default null类型字段设置为sql.NullXXX类型

This commit is contained in:
jiang4869
2022-03-05 21:21:35 +08:00
parent b8cbd4fb30
commit 3e27119ceb
3 changed files with 35 additions and 1 deletions

View File

@@ -25,7 +25,8 @@ type Config struct {
IsGUI bool `yaml:"is_gui"` //
IsTableName bool `yaml:"is_table_name"`
IsNullToPoint bool `yaml:"is_null_to_point"` // null to porint
TablePrefix string `yaml:"table_prefix"` // 表前缀
IsNullToSqlNull bool `yaml:"is_null_to_sql_null"`
TablePrefix string `yaml:"table_prefix"` // 表前缀
SelfTypeDef map[string]string `yaml:"self_type_define"`
OutFileName string `yaml:"out_file_name"`
WebTagType int `yaml:"web_tag_type"` // 默认小驼峰
@@ -226,6 +227,14 @@ func GetIsNullToPoint() bool {
return _map.IsNullToPoint
}
func SetIsNullToSqlNull(b bool) {
_map.IsNullToSqlNull = b
}
func GetIsNullToSqlNull() bool {
return _map.IsNullToSqlNull
}
// SetTablePrefix set table prefix
func SetTablePrefix(t string) {
_map.TablePrefix = t