From 169f258a9460cad451f3025d2ef8df1bbd42a003 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 26 Oct 2024 08:57:24 +0200 Subject: [PATCH] fix: restore explicit column: name override (#984) Accidentally removed in commit 9052fc4cdf3a1e06facae872d0f2c12d0b1e5bfb. --- internal/dbtest/query_test.go | 11 +++++++++++ .../dbtest/testdata/snapshots/TestQuery-mariadb-167 | 1 + .../dbtest/testdata/snapshots/TestQuery-mssql2019-167 | 1 + .../dbtest/testdata/snapshots/TestQuery-mysql5-167 | 1 + .../dbtest/testdata/snapshots/TestQuery-mysql8-167 | 1 + internal/dbtest/testdata/snapshots/TestQuery-pg-167 | 1 + internal/dbtest/testdata/snapshots/TestQuery-pgx-167 | 1 + .../dbtest/testdata/snapshots/TestQuery-sqlite-167 | 1 + 8 files changed, 18 insertions(+) create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-mariadb-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-mysql5-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-mysql8-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-pg-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-pgx-167 create mode 100644 internal/dbtest/testdata/snapshots/TestQuery-sqlite-167 diff --git a/internal/dbtest/query_test.go b/internal/dbtest/query_test.go index 00f6636db..f232d77e2 100644 --- a/internal/dbtest/query_test.go +++ b/internal/dbtest/query_test.go @@ -1545,6 +1545,17 @@ func TestQuery(t *testing.T) { return db.NewInsert().Model(new(Model)) }, }, + { + id: 167, + query: func(db *bun.DB) schema.QueryAppender { + // specified option names + type Model struct { + bun.BaseModel `bun:"table:table"` + IsDefault bool `bun:"column:default"` + } + return db.NewInsert().Model(new(Model)) + }, + }, } timeRE := regexp.MustCompile(`'2\d{3}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d+)?(\+\d{2}:\d{2})?'`) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mariadb-167 b/internal/dbtest/testdata/snapshots/TestQuery-mariadb-167 new file mode 100644 index 000000000..75a22a892 --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-mariadb-167 @@ -0,0 +1 @@ +INSERT INTO `table` (`default`) VALUES (FALSE) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167 b/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167 new file mode 100644 index 000000000..31c90bb0d --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167 @@ -0,0 +1 @@ +INSERT INTO "table" ("default") VALUES (0) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mysql5-167 b/internal/dbtest/testdata/snapshots/TestQuery-mysql5-167 new file mode 100644 index 000000000..75a22a892 --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-mysql5-167 @@ -0,0 +1 @@ +INSERT INTO `table` (`default`) VALUES (FALSE) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-mysql8-167 b/internal/dbtest/testdata/snapshots/TestQuery-mysql8-167 new file mode 100644 index 000000000..75a22a892 --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-mysql8-167 @@ -0,0 +1 @@ +INSERT INTO `table` (`default`) VALUES (FALSE) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-pg-167 b/internal/dbtest/testdata/snapshots/TestQuery-pg-167 new file mode 100644 index 000000000..33c77f71b --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-pg-167 @@ -0,0 +1 @@ +INSERT INTO "table" ("default") VALUES (FALSE) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-pgx-167 b/internal/dbtest/testdata/snapshots/TestQuery-pgx-167 new file mode 100644 index 000000000..33c77f71b --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-pgx-167 @@ -0,0 +1 @@ +INSERT INTO "table" ("default") VALUES (FALSE) diff --git a/internal/dbtest/testdata/snapshots/TestQuery-sqlite-167 b/internal/dbtest/testdata/snapshots/TestQuery-sqlite-167 new file mode 100644 index 000000000..33c77f71b --- /dev/null +++ b/internal/dbtest/testdata/snapshots/TestQuery-sqlite-167 @@ -0,0 +1 @@ +INSERT INTO "table" ("default") VALUES (FALSE)