2 files changed +192
-196
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ export const apply = ({
34
34
let output = `
35
35
package database
36
36
37
- import "database/sql"
38
-
39
37
${ tables
40
38
. filter ( ( table ) => schemas . some ( ( schema ) => schema . name === table . schema ) )
41
39
. flatMap ( ( table ) =>
@@ -275,13 +273,13 @@ const GO_TYPE_MAP = {
275
273
type GoType = ( typeof GO_TYPE_MAP ) [ keyof typeof GO_TYPE_MAP ]
276
274
277
275
const GO_NULLABLE_TYPE_MAP : Record < GoType , string > = {
278
- string : 'sql.NullString ' ,
279
- bool : 'sql.NullBool ' ,
280
- int16 : 'sql.NullInt32 ' ,
281
- int32 : 'sql.NullInt32 ' ,
282
- int64 : 'sql.NullInt64 ' ,
283
- float32 : 'sql.NullFloat64 ' ,
284
- float64 : 'sql.NullFloat64 ' ,
276
+ string : '*string ' ,
277
+ bool : '*bool ' ,
278
+ int16 : '*int16 ' ,
279
+ int32 : '*int32 ' ,
280
+ int64 : '*int64 ' ,
281
+ float32 : '*float32 ' ,
282
+ float64 : '*float64 ' ,
285
283
'[]byte' : '[]byte' ,
286
284
'interface{}' : 'interface{}' ,
287
285
'map[string]interface{}' : 'map[string]interface{}' ,
0 commit comments