fix(writer): update nullable type handling to use baselib
* change default nullable type from resolvespec to baselib * update type mappings in tests to reflect new nullable types * adjust comments for clarity on nullable type options
This commit is contained in:
@@ -70,7 +70,7 @@ func TestWriter_WriteTable(t *testing.T) {
|
||||
"ID",
|
||||
"int64",
|
||||
"Email",
|
||||
"sql_types.SqlString",
|
||||
"*string",
|
||||
"CreatedAt",
|
||||
"time.Time",
|
||||
"gorm:\"column:id",
|
||||
@@ -700,17 +700,17 @@ func TestTypeMapper_SQLTypeToGoType(t *testing.T) {
|
||||
want string
|
||||
}{
|
||||
{"bigint", true, "int64"},
|
||||
{"bigint", false, "sql_types.SqlInt64"},
|
||||
{"bigint", false, "*int64"},
|
||||
{"varchar", true, "string"},
|
||||
{"varchar", false, "sql_types.SqlString"},
|
||||
{"varchar", false, "*string"},
|
||||
{"timestamp", true, "time.Time"},
|
||||
{"timestamp", false, "sql_types.SqlTimeStamp"},
|
||||
{"timestamp", false, "*time.Time"},
|
||||
{"boolean", true, "bool"},
|
||||
{"boolean", false, "sql_types.SqlBool"},
|
||||
{"text[]", true, "sql_types.SqlStringArray"},
|
||||
{"text[]", false, "sql_types.SqlStringArray"},
|
||||
{"integer[]", true, "sql_types.SqlInt32Array"},
|
||||
{"bigint[]", false, "sql_types.SqlInt64Array"},
|
||||
{"boolean", false, "*bool"},
|
||||
{"text[]", true, "[]string"},
|
||||
{"text[]", false, "[]string"},
|
||||
{"integer[]", true, "[]int32"},
|
||||
{"bigint[]", false, "[]int64"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user