From 27833d046ac0134a29e7c1773cf178e3ee1c12a5 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 4 Oct 2023 10:19:38 -0700 Subject: [PATCH] test: Fix a few incorrect testcases These test cases weren't valid when sent to a running PostgreSQL database. --- internal/endtoend/testdata/any/pgx/v4/go/query.sql.go | 2 +- internal/endtoend/testdata/any/pgx/v4/query.sql | 2 +- internal/endtoend/testdata/any/pgx/v5/go/query.sql.go | 2 +- internal/endtoend/testdata/any/pgx/v5/query.sql | 2 +- internal/endtoend/testdata/any/stdlib/go/query.sql.go | 2 +- internal/endtoend/testdata/any/stdlib/query.sql | 2 +- .../comment_godoc/postgresql/pgx/v4/go/query.sql.go | 6 +++--- .../testdata/comment_godoc/postgresql/pgx/v4/query.sql | 6 +++--- .../comment_godoc/postgresql/pgx/v5/go/query.sql.go | 6 +++--- .../testdata/comment_godoc/postgresql/pgx/v5/query.sql | 6 +++--- .../postgresql/pgx/v4/go/query.sql.go | 6 +++--- .../comment_godoc_db_argument/postgresql/pgx/v4/query.sql | 6 +++--- .../postgresql/pgx/v5/go/query.sql.go | 6 +++--- .../comment_godoc_db_argument/postgresql/pgx/v5/query.sql | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/internal/endtoend/testdata/any/pgx/v4/go/query.sql.go b/internal/endtoend/testdata/any/pgx/v4/go/query.sql.go index bb7fc45673..81a44431ce 100644 --- a/internal/endtoend/testdata/any/pgx/v4/go/query.sql.go +++ b/internal/endtoend/testdata/any/pgx/v4/go/query.sql.go @@ -12,7 +12,7 @@ import ( const any = `-- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]) +WHERE id = ANY($1::bigint[]) ` func (q *Queries) Any(ctx context.Context, dollar_1 []int64) ([]int64, error) { diff --git a/internal/endtoend/testdata/any/pgx/v4/query.sql b/internal/endtoend/testdata/any/pgx/v4/query.sql index 8f8c9b8072..82f863a2a0 100644 --- a/internal/endtoend/testdata/any/pgx/v4/query.sql +++ b/internal/endtoend/testdata/any/pgx/v4/query.sql @@ -1,4 +1,4 @@ -- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]); +WHERE id = ANY($1::bigint[]); diff --git a/internal/endtoend/testdata/any/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/any/pgx/v5/go/query.sql.go index bb7fc45673..81a44431ce 100644 --- a/internal/endtoend/testdata/any/pgx/v5/go/query.sql.go +++ b/internal/endtoend/testdata/any/pgx/v5/go/query.sql.go @@ -12,7 +12,7 @@ import ( const any = `-- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]) +WHERE id = ANY($1::bigint[]) ` func (q *Queries) Any(ctx context.Context, dollar_1 []int64) ([]int64, error) { diff --git a/internal/endtoend/testdata/any/pgx/v5/query.sql b/internal/endtoend/testdata/any/pgx/v5/query.sql index 8f8c9b8072..82f863a2a0 100644 --- a/internal/endtoend/testdata/any/pgx/v5/query.sql +++ b/internal/endtoend/testdata/any/pgx/v5/query.sql @@ -1,4 +1,4 @@ -- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]); +WHERE id = ANY($1::bigint[]); diff --git a/internal/endtoend/testdata/any/stdlib/go/query.sql.go b/internal/endtoend/testdata/any/stdlib/go/query.sql.go index df94520be8..c150abffa1 100644 --- a/internal/endtoend/testdata/any/stdlib/go/query.sql.go +++ b/internal/endtoend/testdata/any/stdlib/go/query.sql.go @@ -14,7 +14,7 @@ import ( const any = `-- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]) +WHERE id = ANY($1::bigint[]) ` func (q *Queries) Any(ctx context.Context, dollar_1 []int64) ([]int64, error) { diff --git a/internal/endtoend/testdata/any/stdlib/query.sql b/internal/endtoend/testdata/any/stdlib/query.sql index 8f8c9b8072..82f863a2a0 100644 --- a/internal/endtoend/testdata/any/stdlib/query.sql +++ b/internal/endtoend/testdata/any/stdlib/query.sql @@ -1,4 +1,4 @@ -- name: Any :many SELECT id FROM bar -WHERE foo = ANY($1::bigserial[]); +WHERE id = ANY($1::bigint[]); diff --git a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/go/query.sql.go b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/go/query.sql.go index 58bad495ac..eed1aa29f9 100644 --- a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/go/query.sql.go +++ b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/go/query.sql.go @@ -13,7 +13,7 @@ import ( ) const execFoo = `-- name: ExecFoo :exec -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :exec @@ -23,7 +23,7 @@ func (q *Queries) ExecFoo(ctx context.Context) error { } const execResultFoo = `-- name: ExecResultFoo :execresult -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execresult @@ -32,7 +32,7 @@ func (q *Queries) ExecResultFoo(ctx context.Context) (pgconn.CommandTag, error) } const execRowFoo = `-- name: ExecRowFoo :execrows -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execrows diff --git a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/query.sql b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/query.sql index 06ab749317..b5fab38de7 100644 --- a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/query.sql +++ b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v4/query.sql @@ -8,12 +8,12 @@ SELECT * FROM foo; -- name: ExecFoo :exec -- This function creates a Foo via :exec -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecRowFoo :execrows -- This function creates a Foo via :execrows -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecResultFoo :execresult -- This function creates a Foo via :execresult -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); diff --git a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/go/query.sql.go index f53a7bca4d..5fbb03309d 100644 --- a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/go/query.sql.go +++ b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/go/query.sql.go @@ -13,7 +13,7 @@ import ( ) const execFoo = `-- name: ExecFoo :exec -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :exec @@ -23,7 +23,7 @@ func (q *Queries) ExecFoo(ctx context.Context) error { } const execResultFoo = `-- name: ExecResultFoo :execresult -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execresult @@ -32,7 +32,7 @@ func (q *Queries) ExecResultFoo(ctx context.Context) (pgconn.CommandTag, error) } const execRowFoo = `-- name: ExecRowFoo :execrows -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execrows diff --git a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/query.sql b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/query.sql index 06ab749317..b5fab38de7 100644 --- a/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/query.sql +++ b/internal/endtoend/testdata/comment_godoc/postgresql/pgx/v5/query.sql @@ -8,12 +8,12 @@ SELECT * FROM foo; -- name: ExecFoo :exec -- This function creates a Foo via :exec -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecRowFoo :execrows -- This function creates a Foo via :execrows -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecResultFoo :execresult -- This function creates a Foo via :execresult -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); diff --git a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/go/query.sql.go b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/go/query.sql.go index 463e30847b..2c5cb462d2 100644 --- a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/go/query.sql.go +++ b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/go/query.sql.go @@ -13,7 +13,7 @@ import ( ) const execFoo = `-- name: ExecFoo :exec -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :exec @@ -23,7 +23,7 @@ func (q *Queries) ExecFoo(ctx context.Context, db DBTX) error { } const execResultFoo = `-- name: ExecResultFoo :execresult -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execresult @@ -32,7 +32,7 @@ func (q *Queries) ExecResultFoo(ctx context.Context, db DBTX) (pgconn.CommandTag } const execRowFoo = `-- name: ExecRowFoo :execrows -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execrows diff --git a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/query.sql b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/query.sql index 06ab749317..b5fab38de7 100644 --- a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/query.sql +++ b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v4/query.sql @@ -8,12 +8,12 @@ SELECT * FROM foo; -- name: ExecFoo :exec -- This function creates a Foo via :exec -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecRowFoo :execrows -- This function creates a Foo via :execrows -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecResultFoo :execresult -- This function creates a Foo via :execresult -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); diff --git a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/go/query.sql.go index 89cb0e2d84..8b45ac579b 100644 --- a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/go/query.sql.go +++ b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/go/query.sql.go @@ -13,7 +13,7 @@ import ( ) const execFoo = `-- name: ExecFoo :exec -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :exec @@ -23,7 +23,7 @@ func (q *Queries) ExecFoo(ctx context.Context, db DBTX) error { } const execResultFoo = `-- name: ExecResultFoo :execresult -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execresult @@ -32,7 +32,7 @@ func (q *Queries) ExecResultFoo(ctx context.Context, db DBTX) (pgconn.CommandTag } const execRowFoo = `-- name: ExecRowFoo :execrows -INSERT INTO foo (bar) VALUES ("bar") +INSERT INTO foo (bar) VALUES ('bar') ` // This function creates a Foo via :execrows diff --git a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/query.sql b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/query.sql index 06ab749317..b5fab38de7 100644 --- a/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/query.sql +++ b/internal/endtoend/testdata/comment_godoc_db_argument/postgresql/pgx/v5/query.sql @@ -8,12 +8,12 @@ SELECT * FROM foo; -- name: ExecFoo :exec -- This function creates a Foo via :exec -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecRowFoo :execrows -- This function creates a Foo via :execrows -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar'); -- name: ExecResultFoo :execresult -- This function creates a Foo via :execresult -INSERT INTO foo (bar) VALUES ("bar"); +INSERT INTO foo (bar) VALUES ('bar');