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:
5
internal/endtoend/testdata/analyze_system_catalog/mysql/exec.json
vendored
Normal file
5
internal/endtoend/testdata/analyze_system_catalog/mysql/exec.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"command": "analyze",
|
||||
"args": ["--dialect", "mysql", "--schema", "schema.sql", "query.sql"],
|
||||
"contexts": ["base"]
|
||||
}
|
||||
7
internal/endtoend/testdata/analyze_system_catalog/mysql/query.sql
vendored
Normal file
7
internal/endtoend/testdata/analyze_system_catalog/mysql/query.sql
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
-- name: ListColumns :many
|
||||
SELECT table_name, column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = ?;
|
||||
|
||||
-- name: CountTables :one
|
||||
SELECT count(*) AS total FROM information_schema.tables WHERE table_type = ?;
|
||||
4
internal/endtoend/testdata/analyze_system_catalog/mysql/schema.sql
vendored
Normal file
4
internal/endtoend/testdata/analyze_system_catalog/mysql/schema.sql
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
CREATE TABLE authors (
|
||||
id BIGINT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL
|
||||
);
|
||||
93
internal/endtoend/testdata/analyze_system_catalog/mysql/stdout.json
vendored
Normal file
93
internal/endtoend/testdata/analyze_system_catalog/mysql/stdout.json
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
[
|
||||
{
|
||||
"name": "ListColumns",
|
||||
"cmd": ":many",
|
||||
"columns": [
|
||||
{
|
||||
"name": "table_name",
|
||||
"type": {
|
||||
"name": "varchar",
|
||||
"args": [
|
||||
{
|
||||
"int": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "columns"
|
||||
},
|
||||
{
|
||||
"name": "column_name",
|
||||
"type": {
|
||||
"name": "varchar",
|
||||
"nullable": true,
|
||||
"args": [
|
||||
{
|
||||
"int": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "columns"
|
||||
},
|
||||
{
|
||||
"name": "data_type",
|
||||
"type": {
|
||||
"name": "longtext",
|
||||
"nullable": true
|
||||
},
|
||||
"table": "columns"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"column": {
|
||||
"name": "table_schema",
|
||||
"type": {
|
||||
"name": "varchar",
|
||||
"args": [
|
||||
{
|
||||
"int": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "columns"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CountTables",
|
||||
"cmd": ":one",
|
||||
"columns": [
|
||||
{
|
||||
"name": "total",
|
||||
"type": {
|
||||
"name": "bigint"
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"column": {
|
||||
"name": "table_type",
|
||||
"type": {
|
||||
"name": "enum",
|
||||
"args": [
|
||||
{
|
||||
"string": "BASE TABLE"
|
||||
},
|
||||
{
|
||||
"string": "VIEW"
|
||||
},
|
||||
{
|
||||
"string": "SYSTEM VIEW"
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "tables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
5
internal/endtoend/testdata/analyze_system_catalog/postgresql/exec.json
vendored
Normal file
5
internal/endtoend/testdata/analyze_system_catalog/postgresql/exec.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"command": "analyze",
|
||||
"args": ["--dialect", "postgresql", "--schema", "schema.sql", "query.sql"],
|
||||
"contexts": ["base"]
|
||||
}
|
||||
7
internal/endtoend/testdata/analyze_system_catalog/postgresql/query.sql
vendored
Normal file
7
internal/endtoend/testdata/analyze_system_catalog/postgresql/query.sql
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
-- name: ListColumns :many
|
||||
SELECT table_name, column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = $1;
|
||||
|
||||
-- name: CountRelations :one
|
||||
SELECT count(*) AS total FROM pg_catalog.pg_class WHERE relkind = $1;
|
||||
4
internal/endtoend/testdata/analyze_system_catalog/postgresql/schema.sql
vendored
Normal file
4
internal/endtoend/testdata/analyze_system_catalog/postgresql/schema.sql
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
CREATE TABLE authors (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
name text NOT NULL
|
||||
);
|
||||
69
internal/endtoend/testdata/analyze_system_catalog/postgresql/stdout.json
vendored
Normal file
69
internal/endtoend/testdata/analyze_system_catalog/postgresql/stdout.json
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
[
|
||||
{
|
||||
"name": "ListColumns",
|
||||
"cmd": ":many",
|
||||
"columns": [
|
||||
{
|
||||
"name": "table_name",
|
||||
"type": {
|
||||
"name": "sql_identifier",
|
||||
"nullable": true
|
||||
},
|
||||
"table": "columns"
|
||||
},
|
||||
{
|
||||
"name": "column_name",
|
||||
"type": {
|
||||
"name": "sql_identifier",
|
||||
"nullable": true
|
||||
},
|
||||
"table": "columns"
|
||||
},
|
||||
{
|
||||
"name": "data_type",
|
||||
"type": {
|
||||
"name": "character_data",
|
||||
"nullable": true
|
||||
},
|
||||
"table": "columns"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"column": {
|
||||
"name": "table_schema",
|
||||
"type": {
|
||||
"name": "sql_identifier",
|
||||
"nullable": true
|
||||
},
|
||||
"table": "columns"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CountRelations",
|
||||
"cmd": ":one",
|
||||
"columns": [
|
||||
{
|
||||
"name": "total",
|
||||
"type": {
|
||||
"name": "bigint"
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"column": {
|
||||
"name": "relkind",
|
||||
"type": {
|
||||
"name": "character"
|
||||
},
|
||||
"table": "pg_class"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user