diff --git a/internal/dbtest/query_test.go b/internal/dbtest/query_test.go index 2143bb6de..65a7d8f06 100644 --- a/internal/dbtest/query_test.go +++ b/internal/dbtest/query_test.go @@ -334,12 +334,12 @@ func TestQuery(t *testing.T) { // "nullzero" marshals zero values as DEFAULT or NULL (if DEFAULT placeholder is not supported) // DB drivers which support DEFAULT placeholder resolve it to NULL for columns that do not have a DEFAULT value. type Model struct { - Int int64 `bun:",nullzero"` - Uint uint64 `bun:",nullzero"` - Str string `bun:",nullzero"` - Time time.Time `bun:",nullzero"` - Bool bool `bun:",nullzero"` - // EmptyStr string `bun:",nullzero"` -- same as Str + Int int64 `bun:",nullzero"` + Uint uint64 `bun:",nullzero"` + Str string `bun:",nullzero"` + Time time.Time `bun:",nullzero"` + Bool bool `bun:",nullzero"` + EmptyStr string `bun:",nullzero"` // same as Str } return db.NewInsert().Model(new(Model)) }, diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mariadb-51 b/internal/dbtest/testdata/snapshots/TestQuery-mariadb-51 index c2b0cb082..80790e98f 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-mariadb-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-mariadb-51 @@ -1 +1 @@ -INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING `int`, `uint`, `str`, `time`, `bool` +INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`, `empty_str`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING `int`, `uint`, `str`, `time`, `bool`, `empty_str` diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-51 b/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-51 index 80ad75d70..280b492a1 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-51 @@ -1 +1 @@ -INSERT INTO "models" ("int", "uint", "str", "time", "bool") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) +INSERT INTO "models" ("int", "uint", "str", "time", "bool", "empty_str") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mysql5-51 b/internal/dbtest/testdata/snapshots/TestQuery-mysql5-51 index b1621f1c7..258004f51 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-mysql5-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-mysql5-51 @@ -1 +1 @@ -INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) +INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`, `empty_str`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mysql8-51 b/internal/dbtest/testdata/snapshots/TestQuery-mysql8-51 index b1621f1c7..258004f51 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-mysql8-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-mysql8-51 @@ -1 +1 @@ -INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) +INSERT INTO `models` (`int`, `uint`, `str`, `time`, `bool`, `empty_str`) VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-pg-51 b/internal/dbtest/testdata/snapshots/TestQuery-pg-51 index 55e65e615..af8c1f986 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-pg-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-pg-51 @@ -1 +1 @@ -INSERT INTO "models" ("int", "uint", "str", "time", "bool") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "int", "uint", "str", "time", "bool" +INSERT INTO "models" ("int", "uint", "str", "time", "bool", "empty_str") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "int", "uint", "str", "time", "bool", "empty_str" diff --git a/internal/dbtest/testdata/snapshots/TestQuery-pgx-51 b/internal/dbtest/testdata/snapshots/TestQuery-pgx-51 index 55e65e615..af8c1f986 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-pgx-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-pgx-51 @@ -1 +1 @@ -INSERT INTO "models" ("int", "uint", "str", "time", "bool") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "int", "uint", "str", "time", "bool" +INSERT INTO "models" ("int", "uint", "str", "time", "bool", "empty_str") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "int", "uint", "str", "time", "bool", "empty_str" diff --git a/internal/dbtest/testdata/snapshots/TestQuery-sqlite-51 b/internal/dbtest/testdata/snapshots/TestQuery-sqlite-51 index cbef01565..fd15e70ab 100644 --- a/internal/dbtest/testdata/snapshots/TestQuery-sqlite-51 +++ b/internal/dbtest/testdata/snapshots/TestQuery-sqlite-51 @@ -1 +1 @@ -INSERT INTO "models" ("int", "uint", "str", "time", "bool") VALUES (NULL, NULL, NULL, NULL, NULL) RETURNING "int", "uint", "str", "time", "bool" +INSERT INTO "models" ("int", "uint", "str", "time", "bool", "empty_str") VALUES (NULL, NULL, NULL, NULL, NULL, NULL) RETURNING "int", "uint", "str", "time", "bool", "empty_str"