snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
This commit is contained in:
2
internal/sql/preprocess/testdata/postgresql/arg/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/arg/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: GetUser :one
|
||||
SELECT id FROM users WHERE name = sqlc.arg(name);
|
||||
2
internal/sql/preprocess/testdata/postgresql/arg/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/arg/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: GetUser :one
|
||||
SELECT id FROM users WHERE name = $1;
|
||||
16
internal/sql/preprocess/testdata/postgresql/arg/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/arg/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 59,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 56,
|
||||
"origin": 56,
|
||||
"name": "name",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/at_sign/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/at_sign/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE name = @name AND age = @age;
|
||||
1
internal/sql/preprocess/testdata/postgresql/at_sign/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/at_sign/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE name = $1 AND age = $2;
|
||||
23
internal/sql/preprocess/testdata/postgresql/at_sign/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/postgresql/at_sign/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 50,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 34,
|
||||
"origin": 34,
|
||||
"name": "name",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 47,
|
||||
"origin": 50,
|
||||
"name": "age",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/at_sign_cast/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/at_sign_cast/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE ok = @flag::bool;
|
||||
1
internal/sql/preprocess/testdata/postgresql/at_sign_cast/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/at_sign_cast/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE ok = $1::bool;
|
||||
16
internal/sql/preprocess/testdata/postgresql/at_sign_cast/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/at_sign_cast/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 32,
|
||||
"origin": 32,
|
||||
"name": "flag",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
3
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/input.sql
vendored
Normal file
3
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/input.sql
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
-- name: SkipVetAll :exec
|
||||
-- @sqlc-vet-disable always-fail no-exec
|
||||
SELECT true FROM users WHERE id = sqlc.arg(id);
|
||||
3
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/output.sql
vendored
Normal file
3
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/output.sql
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
-- name: SkipVetAll :exec
|
||||
-- @sqlc-vet-disable always-fail no-exec
|
||||
SELECT true FROM users WHERE id = $1;
|
||||
16
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/at_sign_in_vet_directive/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 104,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 101,
|
||||
"origin": 101,
|
||||
"name": "id",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/comment_inside_call/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/comment_inside_call/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg/* here */(name);
|
||||
1
internal/sql/preprocess/testdata/postgresql/comment_inside_call/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/comment_inside_call/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT $1;
|
||||
16
internal/sql/preprocess/testdata/postgresql/comment_inside_call/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/comment_inside_call/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"name": "name",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed(users), sqlc.embed(pets) FROM users JOIN pets ON true;
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT users.*, pets.* FROM users JOIN pets ON true;
|
||||
21
internal/sql/preprocess/testdata/postgresql/embed/side_table.json
vendored
Normal file
21
internal/sql/preprocess/testdata/postgresql/embed/side_table.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 52,
|
||||
"dollar": true,
|
||||
"embeds": [
|
||||
{
|
||||
"table": "users",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(users)"
|
||||
},
|
||||
{
|
||||
"table": "pets",
|
||||
"location": 16,
|
||||
"origin": 26,
|
||||
"orig": "sqlc.embed(pets)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed(a), b.* FROM a, b;
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT a.*, b.* FROM a, b;
|
||||
15
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/side_table.json
vendored
Normal file
15
internal/sql/preprocess/testdata/postgresql/embed_and_user_star/side_table.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"dollar": true,
|
||||
"embeds": [
|
||||
{
|
||||
"table": "a",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(a)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed("Users") FROM "Users";
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT "Users".* FROM "Users";
|
||||
15
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/side_table.json
vendored
Normal file
15
internal/sql/preprocess/testdata/postgresql/embed_quoted_identifier/side_table.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"dollar": true,
|
||||
"embeds": [
|
||||
{
|
||||
"table": "Users",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(\"Users\")"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_string_constant/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_string_constant/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed('t') FROM t;
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_string_constant/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_string_constant/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT t.* FROM t;
|
||||
15
internal/sql/preprocess/testdata/postgresql/embed_string_constant/side_table.json
vendored
Normal file
15
internal/sql/preprocess/testdata/postgresql/embed_string_constant/side_table.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"dollar": true,
|
||||
"embeds": [
|
||||
{
|
||||
"table": "t",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(t)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_with_args/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_with_args/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed(a), b.name FROM a JOIN b ON b.id = a.b_id WHERE a.id = sqlc.arg(id);
|
||||
1
internal/sql/preprocess/testdata/postgresql/embed_with_args/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/embed_with_args/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT a.*, b.name FROM a JOIN b ON b.id = a.b_id WHERE a.id = $1;
|
||||
24
internal/sql/preprocess/testdata/postgresql/embed_with_args/side_table.json
vendored
Normal file
24
internal/sql/preprocess/testdata/postgresql/embed_with_args/side_table.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 66,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 63,
|
||||
"origin": 73,
|
||||
"name": "id",
|
||||
"named": true
|
||||
}
|
||||
],
|
||||
"embeds": [
|
||||
{
|
||||
"table": "a",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(a)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
2
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT sqlc.argh(a);
|
||||
SELECT sqlc.arg(b);
|
||||
2
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT sqlc.argh(a);
|
||||
SELECT $1;
|
||||
23
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"dollar": true,
|
||||
"error": "function \"sqlc.argh\" does not exist",
|
||||
"error_at": 7
|
||||
},
|
||||
{
|
||||
"start": 20,
|
||||
"end": 31,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 28,
|
||||
"origin": 28,
|
||||
"name": "b",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_is_per_statement/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: function "sqlc.argh" does not exist
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg(sqlc.arg(a));
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg(sqlc.arg(a));
|
||||
9
internal/sql/preprocess/testdata/postgresql/error_nested_call/side_table.json
vendored
Normal file
9
internal/sql/preprocess/testdata/postgresql/error_nested_call/side_table.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"dollar": true,
|
||||
"error": "expected parameter to sqlc.arg to be string or reference; got \"sqlc.arg(a)\"",
|
||||
"error_at": 7
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_nested_call/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: expected parameter to sqlc.arg to be string or reference; got "sqlc.arg(a)"
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg();
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg();
|
||||
9
internal/sql/preprocess/testdata/postgresql/error_no_arguments/side_table.json
vendored
Normal file
9
internal/sql/preprocess/testdata/postgresql/error_no_arguments/side_table.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"dollar": true,
|
||||
"error": "expected 1 parameter to sqlc.arg; got 0",
|
||||
"error_at": 7
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_no_arguments/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: expected 1 parameter to sqlc.arg; got 0
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = $2 AND b = $3;
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = $2 AND b = $3;
|
||||
22
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/side_table.json
vendored
Normal file
22
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/side_table.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 2,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"number": 3,
|
||||
"location": 42,
|
||||
"origin": 42,
|
||||
"named": false
|
||||
}
|
||||
],
|
||||
"param_error": "could not determine data type of parameter $1"
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_numbering_gap/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:1: could not determine data type of parameter $1
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg($1);
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg($1);
|
||||
9
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/side_table.json
vendored
Normal file
9
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/side_table.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"dollar": true,
|
||||
"error": "expected parameter to sqlc.arg to be string or reference; got \"$1\"",
|
||||
"error_at": 7
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_placeholder_argument/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: expected parameter to sqlc.arg to be string or reference; got "$1"
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg('a', 'b');
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg('a', 'b');
|
||||
9
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/side_table.json
vendored
Normal file
9
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/side_table.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"dollar": true,
|
||||
"error": "expected 1 parameter to sqlc.arg; got 2",
|
||||
"error_at": 7
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_too_many_arguments/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: expected 1 parameter to sqlc.arg; got 2
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.argh(a);
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.argh(a);
|
||||
9
internal/sql/preprocess/testdata/postgresql/error_unknown_function/side_table.json
vendored
Normal file
9
internal/sql/preprocess/testdata/postgresql/error_unknown_function/side_table.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"dollar": true,
|
||||
"error": "function \"sqlc.argh\" does not exist",
|
||||
"error_at": 7
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/error_unknown_function/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:8: function "sqlc.argh" does not exist
|
||||
1
internal/sql/preprocess/testdata/postgresql/existing_placeholder/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/existing_placeholder/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = $1 AND b = sqlc.arg(x);
|
||||
1
internal/sql/preprocess/testdata/postgresql/existing_placeholder/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/existing_placeholder/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = $1 AND b = $2;
|
||||
22
internal/sql/preprocess/testdata/postgresql/existing_placeholder/side_table.json
vendored
Normal file
22
internal/sql/preprocess/testdata/postgresql/existing_placeholder/side_table.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 42,
|
||||
"origin": 42,
|
||||
"name": "x",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/extra_whitespace/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/extra_whitespace/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg ( name ), sqlc . arg(other);
|
||||
1
internal/sql/preprocess/testdata/postgresql/extra_whitespace/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/extra_whitespace/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT $1, $2;
|
||||
23
internal/sql/preprocess/testdata/postgresql/extra_whitespace/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/postgresql/extra_whitespace/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"name": "name",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 11,
|
||||
"origin": 28,
|
||||
"name": "other",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
2
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT * FROM transactions
|
||||
WHERE jsonb_extract_path(transactions.data, '$.transaction.signatures[0]') @> to_jsonb(sqlc.arg('data')::text);
|
||||
2
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT * FROM transactions
|
||||
WHERE jsonb_extract_path(transactions.data, '$.transaction.signatures[0]') @> to_jsonb($1::text);
|
||||
16
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/jsonb_operator_and_path_string/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 124,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 114,
|
||||
"origin": 114,
|
||||
"name": "data",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
3
internal/sql/preprocess/testdata/postgresql/multiline_call/input.sql
vendored
Normal file
3
internal/sql/preprocess/testdata/postgresql/multiline_call/input.sql
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
SELECT sqlc.arg(
|
||||
name
|
||||
);
|
||||
1
internal/sql/preprocess/testdata/postgresql/multiline_call/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/multiline_call/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT $1;
|
||||
16
internal/sql/preprocess/testdata/postgresql/multiline_call/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/postgresql/multiline_call/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"name": "name",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
2
internal/sql/preprocess/testdata/postgresql/narg/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/narg/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: GetUser :one
|
||||
SELECT id FROM users WHERE name = sqlc.narg(name);
|
||||
2
internal/sql/preprocess/testdata/postgresql/narg/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/narg/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: GetUser :one
|
||||
SELECT id FROM users WHERE name = $1;
|
||||
17
internal/sql/preprocess/testdata/postgresql/narg/side_table.json
vendored
Normal file
17
internal/sql/preprocess/testdata/postgresql/narg/side_table.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 59,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 56,
|
||||
"origin": 56,
|
||||
"name": "name",
|
||||
"named": true,
|
||||
"nullable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/narg_string_constant/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/narg_string_constant/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE name = COALESCE(sqlc.narg('name'), name);
|
||||
1
internal/sql/preprocess/testdata/postgresql/narg_string_constant/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/narg_string_constant/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE name = COALESCE($1, name);
|
||||
17
internal/sql/preprocess/testdata/postgresql/narg_string_constant/side_table.json
vendored
Normal file
17
internal/sql/preprocess/testdata/postgresql/narg_string_constant/side_table.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 52,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 42,
|
||||
"origin": 42,
|
||||
"name": "name",
|
||||
"named": true,
|
||||
"nullable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
2
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT sqlc.arg(a);
|
||||
SELECT sqlc.arg(b);
|
||||
2
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
SELECT $1;
|
||||
SELECT $1;
|
||||
30
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/side_table.json
vendored
Normal file
30
internal/sql/preprocess/testdata/postgresql/numbering_restarts_per_statement/side_table.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"name": "a",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 10,
|
||||
"end": 21,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 18,
|
||||
"origin": 27,
|
||||
"name": "b",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/quoted_names/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/quoted_names/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.arg('a'), sqlc.arg("b");
|
||||
1
internal/sql/preprocess/testdata/postgresql/quoted_names/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/quoted_names/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT $1, $2;
|
||||
23
internal/sql/preprocess/testdata/postgresql/quoted_names/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/postgresql/quoted_names/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"name": "a",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 11,
|
||||
"origin": 22,
|
||||
"name": "b",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/repeated_name/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/repeated_name/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = sqlc.arg(x) OR b = sqlc.arg(x) OR c = sqlc.arg(y);
|
||||
1
internal/sql/preprocess/testdata/postgresql/repeated_name/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/repeated_name/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = $1 OR b = $1 OR c = $2;
|
||||
30
internal/sql/preprocess/testdata/postgresql/repeated_name/side_table.json
vendored
Normal file
30
internal/sql/preprocess/testdata/postgresql/repeated_name/side_table.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 54,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"name": "x",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 1,
|
||||
"location": 41,
|
||||
"origin": 50,
|
||||
"name": "x",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 51,
|
||||
"origin": 69,
|
||||
"name": "y",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
3
internal/sql/preprocess/testdata/postgresql/skip_block_comment/input.sql
vendored
Normal file
3
internal/sql/preprocess/testdata/postgresql/skip_block_comment/input.sql
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* sqlc.arg(nope)
|
||||
@nope */
|
||||
SELECT 1;
|
||||
3
internal/sql/preprocess/testdata/postgresql/skip_block_comment/output.sql
vendored
Normal file
3
internal/sql/preprocess/testdata/postgresql/skip_block_comment/output.sql
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* sqlc.arg(nope)
|
||||
@nope */
|
||||
SELECT 1;
|
||||
7
internal/sql/preprocess/testdata/postgresql/skip_block_comment/side_table.json
vendored
Normal file
7
internal/sql/preprocess/testdata/postgresql/skip_block_comment/side_table.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"dollar": true
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
CREATE FUNCTION f() RETURNS int AS $$ SELECT sqlc.arg(nope); $$ LANGUAGE sql;
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
CREATE FUNCTION f() RETURNS int AS $$ SELECT sqlc.arg(nope); $$ LANGUAGE sql;
|
||||
7
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/side_table.json
vendored
Normal file
7
internal/sql/preprocess/testdata/postgresql/skip_dollar_quoted/side_table.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 77,
|
||||
"dollar": true
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_escape_string/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_escape_string/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT E'\' sqlc.arg(nope)';
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_escape_string/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_escape_string/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT E'\' sqlc.arg(nope)';
|
||||
7
internal/sql/preprocess/testdata/postgresql/skip_escape_string/side_table.json
vendored
Normal file
7
internal/sql/preprocess/testdata/postgresql/skip_escape_string/side_table.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 28,
|
||||
"dollar": true
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT 1 FROM t WHERE a @> b AND j ? 'a';
|
||||
1
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT 1 FROM t WHERE a @> b AND j ? 'a';
|
||||
7
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/side_table.json
vendored
Normal file
7
internal/sql/preprocess/testdata/postgresql/skip_jsonb_operators/side_table.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"dollar": true
|
||||
}
|
||||
]
|
||||
2
internal/sql/preprocess/testdata/postgresql/skip_line_comment/input.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/skip_line_comment/input.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: Get :one -- sqlc.arg(nope) @nope
|
||||
SELECT 1;
|
||||
2
internal/sql/preprocess/testdata/postgresql/skip_line_comment/output.sql
vendored
Normal file
2
internal/sql/preprocess/testdata/postgresql/skip_line_comment/output.sql
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
-- name: Get :one -- sqlc.arg(nope) @nope
|
||||
SELECT 1;
|
||||
7
internal/sql/preprocess/testdata/postgresql/skip_line_comment/side_table.json
vendored
Normal file
7
internal/sql/preprocess/testdata/postgresql/skip_line_comment/side_table.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 51,
|
||||
"dollar": true
|
||||
}
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user