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

This commit is contained in:
upstream-mirror
2026-09-16 02:17:34 +05:00
commit 0f4df23290
7340 changed files with 238743 additions and 0 deletions

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = sqlc.arg(x) AND b = sqlc.arg(y);

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = ?2;

View 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
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE name = @name;

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE name = ?1;

View File

@@ -0,0 +1,16 @@
[
{
"start": 0,
"end": 37,
"dollar": true,
"params": [
{
"number": 1,
"location": 34,
"origin": 34,
"name": "name",
"named": true
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT sqlc.embed(users) FROM users WHERE id = sqlc.arg(id);

View File

@@ -0,0 +1 @@
SELECT users.* FROM users WHERE id = ?1;

View 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)"
}
]
}
]

View 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(?);

View 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(?);

View 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
}
]

View 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 "?"

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = ?;

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = ?;

View 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"
}
]

View File

@@ -0,0 +1 @@
1:1: can not mix $1 format with ? format

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = sqlc.arg(x);

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = ?2;

View 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
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT * FROM users WHERE name = sqlc.narg(name);

View File

@@ -0,0 +1 @@
SELECT * FROM users WHERE name = ?1;

View File

@@ -0,0 +1,17 @@
[
{
"start": 0,
"end": 36,
"dollar": true,
"params": [
{
"number": 1,
"location": 33,
"origin": 33,
"name": "name",
"named": true,
"nullable": true
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = sqlc.arg(x) AND b = sqlc.arg(x);

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE a = ?1 AND b = ?1;

View 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
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE id IN (sqlc.slice(ids));

View File

@@ -0,0 +1 @@
SELECT id FROM users WHERE id IN (/*SLICE:ids*/?);

View File

@@ -0,0 +1,17 @@
[
{
"start": 0,
"end": 50,
"dollar": true,
"params": [
{
"number": 1,
"location": 47,
"origin": 34,
"name": "ids",
"named": true,
"slice": true
}
]
}
]

View File

@@ -0,0 +1 @@
SELECT * FROM users WHERE a = sqlc.arg('x') AND b = sqlc.narg('y') AND c IN (sqlc.slice('ids'));

View File

@@ -0,0 +1 @@
SELECT * FROM users WHERE a = ?1 AND b = ?2 AND c IN (/*SLICE:ids*/?);

View 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
}
]
}
]