Skip to content

Commit 4f0731b

Browse files
committed
fixed rebase bugs
1 parent 810f911 commit 4f0731b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

internal/codegen/golang/postgresql_type.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) string {
206206
if notNull {
207207
return "time.Time"
208208
}
209+
if emitPointersForNull {
210+
return "*time.Time"
211+
}
209212
return "sql.NullTime"
210213

211214
case "pg_catalog.time":
@@ -215,6 +218,9 @@ func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) string {
215218
if notNull {
216219
return "time.Time"
217220
}
221+
if emitPointersForNull {
222+
return "*time.Time"
223+
}
218224
return "sql.NullTime"
219225

220226
case "pg_catalog.timetz":

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"fmt"
88
"io"
99

10-
yaml "gopkg.in/yaml.v3"
10+
"gopkg.in/yaml.v3"
1111
)
1212

1313
type versionSetting struct {
@@ -119,7 +119,7 @@ type SQLGo struct {
119119
EmitResultStructPointers bool `json:"emit_result_struct_pointers" yaml:"emit_result_struct_pointers"`
120120
EmitParamsStructPointers bool `json:"emit_params_struct_pointers" yaml:"emit_params_struct_pointers"`
121121
EmitMethodsWithDBArgument bool `json:"emit_methods_with_db_argument,omitempty" yaml:"emit_methods_with_db_argument"`
122-
EmitPointersForNullTypes bool `json:"emit_pointers_for_null_types" yaml:"emit_pointers_for_null_types"`
122+
EmitPointersForNullTypes bool `json:"emit_pointers_for_null_types" yaml:"emit_pointers_for_null_types"`
123123
EmitEnumValidMethod bool `json:"emit_enum_valid_method,omitempty" yaml:"emit_enum_valid_method"`
124124
EmitAllEnumValues bool `json:"emit_all_enum_values,omitempty" yaml:"emit_all_enum_values"`
125125
JSONTagsCaseStyle string `json:"json_tags_case_style,omitempty" yaml:"json_tags_case_style"`

0 commit comments

Comments
 (0)