diff --git a/examples/batch/postgresql/models.go b/examples/batch/postgresql/models.go index 9b95a3cdfc..5b1b51a7b0 100644 --- a/examples/batch/postgresql/models.go +++ b/examples/batch/postgresql/models.go @@ -51,7 +51,7 @@ func (ns NullBookType) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.BookType, nil + return string(ns.BookType), nil } type Author struct { diff --git a/examples/booktest/mysql/models.go b/examples/booktest/mysql/models.go index 90ca3680ab..c869e72f12 100644 --- a/examples/booktest/mysql/models.go +++ b/examples/booktest/mysql/models.go @@ -49,7 +49,7 @@ func (ns NullBooksBookType) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.BooksBookType, nil + return string(ns.BooksBookType), nil } type Author struct { diff --git a/examples/booktest/postgresql/models.go b/examples/booktest/postgresql/models.go index 699acb8ef5..f62493ac4e 100644 --- a/examples/booktest/postgresql/models.go +++ b/examples/booktest/postgresql/models.go @@ -49,7 +49,7 @@ func (ns NullBookType) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.BookType, nil + return string(ns.BookType), nil } type Author struct { diff --git a/examples/ondeck/mysql/models.go b/examples/ondeck/mysql/models.go index f101c661ba..874889647a 100644 --- a/examples/ondeck/mysql/models.go +++ b/examples/ondeck/mysql/models.go @@ -50,7 +50,7 @@ func (ns NullVenuesStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.VenuesStatus, nil + return string(ns.VenuesStatus), nil } type City struct { diff --git a/examples/ondeck/postgresql/models.go b/examples/ondeck/postgresql/models.go index 4b65d054d0..1fba70de60 100644 --- a/examples/ondeck/postgresql/models.go +++ b/examples/ondeck/postgresql/models.go @@ -51,7 +51,7 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } type City struct { diff --git a/internal/codegen/golang/templates/template.tmpl b/internal/codegen/golang/templates/template.tmpl index 2ea0573036..9b730db073 100644 --- a/internal/codegen/golang/templates/template.tmpl +++ b/internal/codegen/golang/templates/template.tmpl @@ -107,7 +107,7 @@ func (ns Null{{.Name}}) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.{{.Name}}, nil + return string(ns.{{.Name}}), nil } diff --git a/internal/endtoend/testdata/comment_on/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/comment_on/postgresql/pgx/v4/go/models.go index d71b7be72b..7ea056fd19 100644 --- a/internal/endtoend/testdata/comment_on/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/comment_on/postgresql/pgx/v4/go/models.go @@ -50,7 +50,7 @@ func (ns NullFooMood) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooMood, nil + return string(ns.FooMood), nil } // this is the bar table diff --git a/internal/endtoend/testdata/comment_on/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/comment_on/postgresql/pgx/v5/go/models.go index d71b7be72b..7ea056fd19 100644 --- a/internal/endtoend/testdata/comment_on/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/comment_on/postgresql/pgx/v5/go/models.go @@ -50,7 +50,7 @@ func (ns NullFooMood) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooMood, nil + return string(ns.FooMood), nil } // this is the bar table diff --git a/internal/endtoend/testdata/comment_on/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/comment_on/postgresql/stdlib/go/models.go index d71b7be72b..7ea056fd19 100644 --- a/internal/endtoend/testdata/comment_on/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/comment_on/postgresql/stdlib/go/models.go @@ -50,7 +50,7 @@ func (ns NullFooMood) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooMood, nil + return string(ns.FooMood), nil } // this is the bar table diff --git a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v4/go/models.go index e8a47dd4a3..9d146a644c 100644 --- a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v4/go/models.go @@ -49,5 +49,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v5/go/models.go index e8a47dd4a3..9d146a644c 100644 --- a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/pgx/v5/go/models.go @@ -49,5 +49,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/stdlib/go/models.go index e8a47dd4a3..9d146a644c 100644 --- a/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_add_value/postgresql/stdlib/go/models.go @@ -49,5 +49,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v4/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v4/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v5/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/pgx/v5/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/stdlib/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename/postgresql/stdlib/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v4/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v4/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v5/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/pgx/v5/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/stdlib/go/models.go index 3efbaecab4..c9df5c0b48 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/stdlib/go/models.go @@ -48,7 +48,7 @@ func (ns NullNewEvent) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.NewEvent, nil + return string(ns.NewEvent), nil } type LogLine struct { diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v4/go/models.go index 9de75236fb..f11cc7fa93 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v4/go/models.go @@ -48,5 +48,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v5/go/models.go index 9de75236fb..f11cc7fa93 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/pgx/v5/go/models.go @@ -48,5 +48,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/stdlib/go/models.go index 9de75236fb..f11cc7fa93 100644 --- a/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_alter_type_rename_value/postgresql/stdlib/go/models.go @@ -48,5 +48,5 @@ func (ns NullStatus) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Status, nil + return string(ns.Status), nil } diff --git a/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v4/go/models.go index 96cacee5a5..8863e0688b 100644 --- a/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v4/go/models.go @@ -49,7 +49,7 @@ func (ns NullFooBat) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooBat, nil + return string(ns.FooBat), nil } // Table comment diff --git a/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v5/go/models.go index d0870b8ad3..5780271993 100644 --- a/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_comment/postgresql/pgx/v5/go/models.go @@ -50,7 +50,7 @@ func (ns NullFooBat) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooBat, nil + return string(ns.FooBat), nil } // Table comment diff --git a/internal/endtoend/testdata/ddl_comment/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_comment/postgresql/stdlib/go/models.go index 96cacee5a5..8863e0688b 100644 --- a/internal/endtoend/testdata/ddl_comment/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_comment/postgresql/stdlib/go/models.go @@ -49,7 +49,7 @@ func (ns NullFooBat) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooBat, nil + return string(ns.FooBat), nil } // Table comment diff --git a/internal/endtoend/testdata/ddl_create_enum/mysql/go/models.go b/internal/endtoend/testdata/ddl_create_enum/mysql/go/models.go index 67584b05e7..e1c8f4953b 100644 --- a/internal/endtoend/testdata/ddl_create_enum/mysql/go/models.go +++ b/internal/endtoend/testdata/ddl_create_enum/mysql/go/models.go @@ -58,7 +58,7 @@ func (ns NullFooDigit) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooDigit, nil + return string(ns.FooDigit), nil } type FooFoobar string @@ -105,7 +105,7 @@ func (ns NullFooFoobar) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooFoobar, nil + return string(ns.FooFoobar), nil } type Foo struct { diff --git a/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v4/go/models.go index 731b6fa9bd..61ddf45d2c 100644 --- a/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v4/go/models.go @@ -58,7 +58,7 @@ func (ns NullDigit) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Digit, nil + return string(ns.Digit), nil } type Foobar string @@ -105,7 +105,7 @@ func (ns NullFoobar) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Foobar, nil + return string(ns.Foobar), nil } type Foo struct { diff --git a/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v5/go/models.go index 731b6fa9bd..61ddf45d2c 100644 --- a/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/ddl_create_enum/postgresql/pgx/v5/go/models.go @@ -58,7 +58,7 @@ func (ns NullDigit) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Digit, nil + return string(ns.Digit), nil } type Foobar string @@ -105,7 +105,7 @@ func (ns NullFoobar) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Foobar, nil + return string(ns.Foobar), nil } type Foo struct { diff --git a/internal/endtoend/testdata/ddl_create_enum/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/ddl_create_enum/postgresql/stdlib/go/models.go index 731b6fa9bd..61ddf45d2c 100644 --- a/internal/endtoend/testdata/ddl_create_enum/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/ddl_create_enum/postgresql/stdlib/go/models.go @@ -58,7 +58,7 @@ func (ns NullDigit) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Digit, nil + return string(ns.Digit), nil } type Foobar string @@ -105,7 +105,7 @@ func (ns NullFoobar) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Foobar, nil + return string(ns.Foobar), nil } type Foo struct { diff --git a/internal/endtoend/testdata/emit_enum_valid_and_values/go/models.go b/internal/endtoend/testdata/emit_enum_valid_and_values/go/models.go index aaecd80aff..1ff3cfa9df 100644 --- a/internal/endtoend/testdata/emit_enum_valid_and_values/go/models.go +++ b/internal/endtoend/testdata/emit_enum_valid_and_values/go/models.go @@ -49,7 +49,7 @@ func (ns NullIPProtocol) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.IPProtocol, nil + return string(ns.IPProtocol), nil } func (e IPProtocol) Valid() bool { diff --git a/internal/endtoend/testdata/enum/mysql/go/models.go b/internal/endtoend/testdata/enum/mysql/go/models.go index 668930fa3a..5319eaa267 100644 --- a/internal/endtoend/testdata/enum/mysql/go/models.go +++ b/internal/endtoend/testdata/enum/mysql/go/models.go @@ -52,7 +52,7 @@ func (ns NullUsersShirtSize) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.UsersShirtSize, nil + return string(ns.UsersShirtSize), nil } type UsersShoeSize string @@ -97,7 +97,7 @@ func (ns NullUsersShoeSize) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.UsersShoeSize, nil + return string(ns.UsersShoeSize), nil } type User struct { diff --git a/internal/endtoend/testdata/enum/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/enum/postgresql/pgx/v4/go/models.go index 437a676a7b..2af4535c17 100644 --- a/internal/endtoend/testdata/enum/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/enum/postgresql/pgx/v4/go/models.go @@ -52,7 +52,7 @@ func (ns NullSize) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Size, nil + return string(ns.Size), nil } type User struct { diff --git a/internal/endtoend/testdata/enum/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/enum/postgresql/pgx/v5/go/models.go index e0c8f78bf1..d8c1b7644d 100644 --- a/internal/endtoend/testdata/enum/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/enum/postgresql/pgx/v5/go/models.go @@ -53,7 +53,7 @@ func (ns NullSize) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Size, nil + return string(ns.Size), nil } type User struct { diff --git a/internal/endtoend/testdata/enum/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/enum/postgresql/stdlib/go/models.go index 437a676a7b..2af4535c17 100644 --- a/internal/endtoend/testdata/enum/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/enum/postgresql/stdlib/go/models.go @@ -52,7 +52,7 @@ func (ns NullSize) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.Size, nil + return string(ns.Size), nil } type User struct { diff --git a/internal/endtoend/testdata/rename/pgx/v4/go/models.go b/internal/endtoend/testdata/rename/pgx/v4/go/models.go index da7fb2d4f1..01d01638f4 100644 --- a/internal/endtoend/testdata/rename/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/rename/pgx/v4/go/models.go @@ -49,7 +49,7 @@ func (ns NullIPProtocol) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.IPProtocol, nil + return string(ns.IPProtocol), nil } type BarNew struct { diff --git a/internal/endtoend/testdata/rename/pgx/v5/go/models.go b/internal/endtoend/testdata/rename/pgx/v5/go/models.go index da7fb2d4f1..01d01638f4 100644 --- a/internal/endtoend/testdata/rename/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/rename/pgx/v5/go/models.go @@ -49,7 +49,7 @@ func (ns NullIPProtocol) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.IPProtocol, nil + return string(ns.IPProtocol), nil } type BarNew struct { diff --git a/internal/endtoend/testdata/rename/stdlib/go/models.go b/internal/endtoend/testdata/rename/stdlib/go/models.go index da7fb2d4f1..01d01638f4 100644 --- a/internal/endtoend/testdata/rename/stdlib/go/models.go +++ b/internal/endtoend/testdata/rename/stdlib/go/models.go @@ -49,7 +49,7 @@ func (ns NullIPProtocol) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.IPProtocol, nil + return string(ns.IPProtocol), nil } type BarNew struct { diff --git a/internal/endtoend/testdata/schema_scoped_enum/pgx/v4/go/models.go b/internal/endtoend/testdata/schema_scoped_enum/pgx/v4/go/models.go index a2399cb1d1..f7caeb7eef 100644 --- a/internal/endtoend/testdata/schema_scoped_enum/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/schema_scoped_enum/pgx/v4/go/models.go @@ -48,7 +48,7 @@ func (ns NullFooTypeUserRole) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooTypeUserRole, nil + return string(ns.FooTypeUserRole), nil } type FooUser struct { diff --git a/internal/endtoend/testdata/schema_scoped_enum/pgx/v5/go/models.go b/internal/endtoend/testdata/schema_scoped_enum/pgx/v5/go/models.go index a2399cb1d1..f7caeb7eef 100644 --- a/internal/endtoend/testdata/schema_scoped_enum/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/schema_scoped_enum/pgx/v5/go/models.go @@ -48,7 +48,7 @@ func (ns NullFooTypeUserRole) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooTypeUserRole, nil + return string(ns.FooTypeUserRole), nil } type FooUser struct { diff --git a/internal/endtoend/testdata/schema_scoped_enum/stdlib/go/models.go b/internal/endtoend/testdata/schema_scoped_enum/stdlib/go/models.go index a2399cb1d1..f7caeb7eef 100644 --- a/internal/endtoend/testdata/schema_scoped_enum/stdlib/go/models.go +++ b/internal/endtoend/testdata/schema_scoped_enum/stdlib/go/models.go @@ -48,7 +48,7 @@ func (ns NullFooTypeUserRole) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } - return ns.FooTypeUserRole, nil + return string(ns.FooTypeUserRole), nil } type FooUser struct {