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:
1
internal/sql/preprocess/testdata/sqlite/arg/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/arg/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = sqlc.arg(x) AND b = sqlc.arg(y);
|
||||
1
internal/sql/preprocess/testdata/sqlite/arg/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/arg/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = ?1 AND b = ?2;
|
||||
23
internal/sql/preprocess/testdata/sqlite/arg/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/sqlite/arg/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"name": "x",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 42,
|
||||
"origin": 51,
|
||||
"name": "y",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/at_sign/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/at_sign/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE name = @name;
|
||||
1
internal/sql/preprocess/testdata/sqlite/at_sign/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/at_sign/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE name = ?1;
|
||||
16
internal/sql/preprocess/testdata/sqlite/at_sign/side_table.json
vendored
Normal file
16
internal/sql/preprocess/testdata/sqlite/at_sign/side_table.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 34,
|
||||
"origin": 34,
|
||||
"name": "name",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/embed/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/embed/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT sqlc.embed(users) FROM users WHERE id = sqlc.arg(id);
|
||||
1
internal/sql/preprocess/testdata/sqlite/embed/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/embed/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT users.* FROM users WHERE id = ?1;
|
||||
24
internal/sql/preprocess/testdata/sqlite/embed/side_table.json
vendored
Normal file
24
internal/sql/preprocess/testdata/sqlite/embed/side_table.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 37,
|
||||
"origin": 47,
|
||||
"name": "id",
|
||||
"named": true
|
||||
}
|
||||
],
|
||||
"embeds": [
|
||||
{
|
||||
"table": "users",
|
||||
"location": 7,
|
||||
"origin": 7,
|
||||
"orig": "sqlc.embed(users)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
11
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/input.sql
vendored
Normal file
11
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/input.sql
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
-- name: WrongFunc :one
|
||||
SELECT id FROM users WHERE id = sqlc.argh(target_id);
|
||||
|
||||
-- name: TooManyArgs :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg('foo', 'bar');
|
||||
|
||||
-- name: TooFewArgs :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg();
|
||||
|
||||
-- name: InvalidArgPlaceholder :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg(?);
|
||||
11
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/output.sql
vendored
Normal file
11
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/output.sql
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
-- name: WrongFunc :one
|
||||
SELECT id FROM users WHERE id = sqlc.argh(target_id);
|
||||
|
||||
-- name: TooManyArgs :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg('foo', 'bar');
|
||||
|
||||
-- name: TooFewArgs :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg();
|
||||
|
||||
-- name: InvalidArgPlaceholder :one
|
||||
SELECT id FROM users WHERE id = sqlc.arg(?);
|
||||
30
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/side_table.json
vendored
Normal file
30
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/side_table.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 77,
|
||||
"dollar": true,
|
||||
"error": "function \"sqlc.argh\" does not exist",
|
||||
"error_at": 56
|
||||
},
|
||||
{
|
||||
"start": 77,
|
||||
"end": 160,
|
||||
"dollar": true,
|
||||
"error": "expected 1 parameter to sqlc.arg; got 2",
|
||||
"error_at": 137
|
||||
},
|
||||
{
|
||||
"start": 160,
|
||||
"end": 230,
|
||||
"dollar": true,
|
||||
"error": "expected 1 parameter to sqlc.arg; got 0",
|
||||
"error_at": 219
|
||||
},
|
||||
{
|
||||
"start": 230,
|
||||
"end": 312,
|
||||
"dollar": true,
|
||||
"error": "expected parameter to sqlc.arg to be string or reference; got \"?\"",
|
||||
"error_at": 300
|
||||
}
|
||||
]
|
||||
4
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/stderr.txt
vendored
Normal file
4
internal/sql/preprocess/testdata/sqlite/error_invalid_calls/stderr.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
2:33: function "sqlc.argh" does not exist
|
||||
5:33: expected 1 parameter to sqlc.arg; got 2
|
||||
8:33: expected 1 parameter to sqlc.arg; got 0
|
||||
11:33: expected parameter to sqlc.arg to be string or reference; got "?"
|
||||
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = ?1 AND b = ?;
|
||||
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = ?1 AND b = ?;
|
||||
22
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/side_table.json
vendored
Normal file
22
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/side_table.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 44,
|
||||
"dollar": false,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 42,
|
||||
"origin": 42,
|
||||
"named": false
|
||||
}
|
||||
],
|
||||
"param_error": "can not mix $1 format with ? format"
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/stderr.txt
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/error_mixed_placeholder_styles/stderr.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1:1: can not mix $1 format with ? format
|
||||
1
internal/sql/preprocess/testdata/sqlite/existing_numbered_placeholder/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/existing_numbered_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/sqlite/existing_numbered_placeholder/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/existing_numbered_placeholder/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = ?1 AND b = ?2;
|
||||
22
internal/sql/preprocess/testdata/sqlite/existing_numbered_placeholder/side_table.json
vendored
Normal file
22
internal/sql/preprocess/testdata/sqlite/existing_numbered_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/sqlite/narg_identifier/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/narg_identifier/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE name = sqlc.narg(name);
|
||||
1
internal/sql/preprocess/testdata/sqlite/narg_identifier/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/narg_identifier/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE name = ?1;
|
||||
17
internal/sql/preprocess/testdata/sqlite/narg_identifier/side_table.json
vendored
Normal file
17
internal/sql/preprocess/testdata/sqlite/narg_identifier/side_table.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 36,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 33,
|
||||
"origin": 33,
|
||||
"name": "name",
|
||||
"named": true,
|
||||
"nullable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/repeated_name/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/repeated_name/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = sqlc.arg(x) AND b = sqlc.arg(x);
|
||||
1
internal/sql/preprocess/testdata/sqlite/repeated_name/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/repeated_name/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE a = ?1 AND b = ?1;
|
||||
23
internal/sql/preprocess/testdata/sqlite/repeated_name/side_table.json
vendored
Normal file
23
internal/sql/preprocess/testdata/sqlite/repeated_name/side_table.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 31,
|
||||
"origin": 31,
|
||||
"name": "x",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 1,
|
||||
"location": 42,
|
||||
"origin": 51,
|
||||
"name": "x",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/slice/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/slice/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE id IN (sqlc.slice(ids));
|
||||
1
internal/sql/preprocess/testdata/sqlite/slice/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/slice/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT id FROM users WHERE id IN (/*SLICE:ids*/?);
|
||||
17
internal/sql/preprocess/testdata/sqlite/slice/side_table.json
vendored
Normal file
17
internal/sql/preprocess/testdata/sqlite/slice/side_table.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 50,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 47,
|
||||
"origin": 34,
|
||||
"name": "ids",
|
||||
"named": true,
|
||||
"slice": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
internal/sql/preprocess/testdata/sqlite/string_constant/input.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/string_constant/input.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE a = sqlc.arg('x') AND b = sqlc.narg('y') AND c IN (sqlc.slice('ids'));
|
||||
1
internal/sql/preprocess/testdata/sqlite/string_constant/output.sql
vendored
Normal file
1
internal/sql/preprocess/testdata/sqlite/string_constant/output.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
SELECT * FROM users WHERE a = ?1 AND b = ?2 AND c IN (/*SLICE:ids*/?);
|
||||
32
internal/sql/preprocess/testdata/sqlite/string_constant/side_table.json
vendored
Normal file
32
internal/sql/preprocess/testdata/sqlite/string_constant/side_table.json
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"start": 0,
|
||||
"end": 70,
|
||||
"dollar": true,
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"location": 30,
|
||||
"origin": 30,
|
||||
"name": "x",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
"location": 41,
|
||||
"origin": 52,
|
||||
"name": "y",
|
||||
"named": true,
|
||||
"nullable": true
|
||||
},
|
||||
{
|
||||
"number": 3,
|
||||
"location": 67,
|
||||
"origin": 77,
|
||||
"name": "ids",
|
||||
"named": true,
|
||||
"slice": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user