Skip to content

Commit a022593

Browse files
authored
feat: add support for pgx/v5 emit_pointers_for_null_types flag (#2269)
1 parent a5b691c commit a022593

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

internal/codegen/golang/postgresql_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) string {
3737
columnType := sdk.DataType(col.Type)
3838
notNull := col.NotNull || col.IsArray
3939
driver := parseDriver(req.Settings.Go.SqlPackage)
40-
emitPointersForNull := driver == SQLDriverPGXV4 && req.Settings.Go.EmitPointersForNullTypes
40+
emitPointersForNull := driver.IsPGX() && req.Settings.Go.EmitPointersForNullTypes
4141

4242
switch columnType {
4343
case "serial", "serial4", "pg_catalog.serial4":

internal/endtoend/testdata/emit_pointers_for_null_types/pgx/v5/go/models.go

Lines changed: 17 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)