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,5 @@
{
"command": "analyze",
"args": ["--dialect", "clickhouse", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,2 @@
INSERT INTO events (id, name, tag, amount, created) VALUES (1, 'signup', NULL, 9.5, '2024-01-01 00:00:00');
INSERT INTO events (id, name, tag, amount, created) VALUES (2, 'login', 'web', 0.5, '2024-01-02 00:00:00');

View File

@@ -0,0 +1,5 @@
-- name: GetEvent :one
SELECT id, name FROM events WHERE id = ?;
-- name: FilterEvents :many
SELECT id, name FROM events WHERE name = ? AND amount > ?;

View File

@@ -0,0 +1,7 @@
CREATE TABLE events (
id UInt64,
name String,
tag Nullable(String),
amount Float64,
created DateTime
) ENGINE = MergeTree ORDER BY id;

View File

@@ -0,0 +1,76 @@
[
{
"name": "GetEvent",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "uint64"
},
"table": "events"
},
{
"name": "name",
"type": {
"name": "string"
},
"table": "events"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "uint64"
},
"table": "events"
}
}
]
},
{
"name": "FilterEvents",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "uint64"
},
"table": "events"
},
{
"name": "name",
"type": {
"name": "string"
},
"table": "events"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "string"
},
"table": "events"
}
},
{
"number": 2,
"column": {
"name": "amount",
"type": {
"name": "float64"
},
"table": "events"
}
}
]
}
]

View File

@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "duckdb", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,8 @@
-- name: GetAuthor :one
SELECT id, name, bio FROM authors WHERE id = $1;
-- name: FilterAuthors :many
SELECT id, name FROM authors WHERE name = $name AND royalties > $royalties;
-- name: SearchAuthors :many
SELECT id FROM authors WHERE name LIKE ? AND bio IS NOT NULL;

View File

@@ -0,0 +1,6 @@
CREATE TABLE authors (
id BIGINT PRIMARY KEY,
name TEXT NOT NULL,
bio TEXT,
royalties DECIMAL(10,2) NOT NULL
);

View File

@@ -0,0 +1,117 @@
[
{
"name": "GetAuthor",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
},
{
"name": "name",
"type": {
"name": "varchar"
},
"table": "authors"
},
{
"name": "bio",
"type": {
"name": "varchar",
"nullable": true
},
"table": "authors"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
}
}
]
},
{
"name": "FilterAuthors",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
},
{
"name": "name",
"type": {
"name": "varchar"
},
"table": "authors"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "varchar"
},
"table": "authors"
}
},
{
"number": 2,
"column": {
"name": "royalties",
"type": {
"name": "decimal",
"args": [
{
"int": 10
},
{
"int": 2
}
]
},
"table": "authors"
}
}
]
},
{
"name": "SearchAuthors",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "varchar"
},
"table": "authors"
}
}
]
}
]

View File

@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "mssql", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,5 @@
-- name: GetAuthor :one
SELECT id, name, bio FROM authors WHERE id = @id;
-- name: FilterAuthors :many
SELECT id, name FROM authors WHERE name = @name AND royalties > @royalties;

View File

@@ -0,0 +1,7 @@
CREATE TABLE authors (
id BIGINT IDENTITY(1,1) PRIMARY KEY,
name NVARCHAR(100) NOT NULL,
bio NVARCHAR(MAX),
royalties DECIMAL(10,2) NOT NULL,
created DATETIME2 NOT NULL
);

View File

@@ -0,0 +1,112 @@
[
{
"name": "GetAuthor",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
},
{
"name": "name",
"type": {
"name": "nvarchar",
"args": [
{
"int": 100
}
]
},
"table": "authors"
},
{
"name": "bio",
"type": {
"name": "nvarchar",
"nullable": true,
"args": [
{
"ident": "max"
}
]
},
"table": "authors"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
}
}
]
},
{
"name": "FilterAuthors",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "authors"
},
{
"name": "name",
"type": {
"name": "nvarchar",
"args": [
{
"int": 100
}
]
},
"table": "authors"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "nvarchar",
"args": [
{
"int": 100
}
]
},
"table": "authors"
}
},
{
"number": 2,
"column": {
"name": "royalties",
"type": {
"name": "decimal",
"args": [
{
"int": 10
},
{
"int": 2
}
]
},
"table": "authors"
}
}
]
}
]

View File

@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "mysql", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,8 @@
-- name: GetUser :one
SELECT id, name FROM users WHERE id = ?;
-- name: FilterUsers :many
SELECT id, name FROM users WHERE name = sqlc.arg(name) AND bio = sqlc.narg(bio);
-- name: UsersByID :many
SELECT id, name FROM users WHERE id IN (sqlc.slice(ids));

View File

@@ -0,0 +1,12 @@
CREATE TABLE users (
id BIGINT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
bio TEXT
);
CREATE TABLE posts (
id BIGINT PRIMARY KEY,
user_id BIGINT NOT NULL,
title VARCHAR(255),
created DATETIME NOT NULL
);

View File

@@ -0,0 +1,129 @@
[
{
"name": "GetUser",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "varchar",
"args": [
{
"int": 255
}
]
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
}
}
]
},
{
"name": "FilterUsers",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "varchar",
"args": [
{
"int": 255
}
]
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "varchar",
"args": [
{
"int": 255
}
]
},
"table": "users"
}
},
{
"number": 2,
"column": {
"name": "bio",
"type": {
"name": "text",
"nullable": true
},
"table": "users"
}
}
]
},
{
"name": "UsersByID",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "varchar",
"args": [
{
"int": 255
}
]
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "ids",
"type": {
"name": "bigint"
},
"table": "users"
}
}
]
}
]

View File

@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "postgresql", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,11 @@
-- name: GetUser :one
SELECT id, name FROM users WHERE id = $1;
-- name: FilterUsers :many
SELECT id, name FROM users WHERE name = sqlc.arg(name) AND bio = sqlc.narg(bio);
-- name: UsersByID :many
SELECT id, name FROM users WHERE id = ANY(sqlc.slice(ids));
-- name: PostsBetween :many
SELECT id, title FROM posts WHERE created BETWEEN $1 AND $2;

View File

@@ -0,0 +1,12 @@
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
CREATE TABLE posts (
id BIGSERIAL PRIMARY KEY,
user_id bigint NOT NULL,
title varchar(255),
created timestamptz NOT NULL
);

View File

@@ -0,0 +1,157 @@
[
{
"name": "GetUser",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
}
}
]
},
{
"name": "FilterUsers",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
},
{
"number": 2,
"column": {
"name": "bio",
"type": {
"name": "text",
"nullable": true
},
"table": "users"
}
}
]
},
{
"name": "UsersByID",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "ids",
"type": {
"name": "bigint"
},
"table": "users"
}
}
]
},
{
"name": "PostsBetween",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "bigint"
},
"table": "posts"
},
{
"name": "title",
"type": {
"name": "character varying",
"nullable": true,
"args": [
{
"int": 255
}
]
},
"table": "posts"
}
],
"params": [
{
"number": 1,
"column": {
"name": "created",
"type": {
"name": "timestamp with time zone"
},
"table": "posts"
}
},
{
"number": 2,
"column": {
"name": "created",
"type": {
"name": "timestamp with time zone"
},
"table": "posts"
}
}
]
}
]

View File

@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "sqlite", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}

View File

@@ -0,0 +1,8 @@
-- name: GetUser :one
SELECT id, name FROM users WHERE id = ?;
-- name: FilterUsers :many
SELECT id, name FROM users WHERE name = sqlc.arg(name) AND bio = sqlc.narg(bio);
-- name: CountPosts :one
SELECT count(*) AS total FROM posts WHERE user_id = ?;

View File

@@ -0,0 +1,12 @@
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
bio TEXT
);
CREATE TABLE posts (
id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL,
title TEXT,
created TEXT NOT NULL
);

View File

@@ -0,0 +1,101 @@
[
{
"name": "GetUser",
"cmd": ":one",
"columns": [
{
"name": "id",
"type": {
"name": "integer"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "id",
"type": {
"name": "integer"
},
"table": "users"
}
}
]
},
{
"name": "FilterUsers",
"cmd": ":many",
"columns": [
{
"name": "id",
"type": {
"name": "integer"
},
"table": "users"
},
{
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
],
"params": [
{
"number": 1,
"column": {
"name": "name",
"type": {
"name": "text"
},
"table": "users"
}
},
{
"number": 2,
"column": {
"name": "bio",
"type": {
"name": "text",
"nullable": true
},
"table": "users"
}
}
]
},
{
"name": "CountPosts",
"cmd": ":one",
"columns": [
{
"name": "total",
"type": {
"name": "integer"
}
}
],
"params": [
{
"number": 1,
"column": {
"name": "user_id",
"type": {
"name": "integer"
},
"table": "posts"
}
}
]
}
]