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_select/googlesql/exec.json
vendored
Normal file
5
internal/endtoend/testdata/analyze_select/googlesql/exec.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"command": "analyze",
|
||||
"args": ["--dialect", "googlesql", "--schema", "schema.sql", "query.sql"],
|
||||
"contexts": ["base"]
|
||||
}
|
||||
8
internal/endtoend/testdata/analyze_select/googlesql/query.sql
vendored
Normal file
8
internal/endtoend/testdata/analyze_select/googlesql/query.sql
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
-- name: ListUsers :many
|
||||
SELECT * FROM users;
|
||||
|
||||
-- name: CountUsers :one
|
||||
SELECT COUNT(*) AS total FROM users;
|
||||
|
||||
-- name: ListUserPosts :many
|
||||
SELECT u.name, p.* FROM users u JOIN posts p ON p.user_id = u.id WHERE u.name = @name;
|
||||
12
internal/endtoend/testdata/analyze_select/googlesql/schema.sql
vendored
Normal file
12
internal/endtoend/testdata/analyze_select/googlesql/schema.sql
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE users (
|
||||
id INT64 NOT NULL,
|
||||
name STRING(MAX) NOT NULL,
|
||||
bio STRING(MAX),
|
||||
) PRIMARY KEY (id);
|
||||
|
||||
CREATE TABLE posts (
|
||||
id INT64 NOT NULL,
|
||||
user_id INT64 NOT NULL,
|
||||
title STRING(255),
|
||||
created TIMESTAMP NOT NULL,
|
||||
) PRIMARY KEY (id);
|
||||
123
internal/endtoend/testdata/analyze_select/googlesql/stdout.json
vendored
Normal file
123
internal/endtoend/testdata/analyze_select/googlesql/stdout.json
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
[
|
||||
{
|
||||
"name": "ListUsers",
|
||||
"cmd": ":many",
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": {
|
||||
"name": "int64"
|
||||
},
|
||||
"table": "users"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": {
|
||||
"name": "string",
|
||||
"args": [
|
||||
{
|
||||
"ident": "max"
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "users"
|
||||
},
|
||||
{
|
||||
"name": "bio",
|
||||
"type": {
|
||||
"name": "string",
|
||||
"nullable": true,
|
||||
"args": [
|
||||
{
|
||||
"ident": "max"
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "users"
|
||||
}
|
||||
],
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"name": "CountUsers",
|
||||
"cmd": ":one",
|
||||
"columns": [
|
||||
{
|
||||
"name": "total",
|
||||
"type": {
|
||||
"name": "int64"
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"name": "ListUserPosts",
|
||||
"cmd": ":many",
|
||||
"columns": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": {
|
||||
"name": "string",
|
||||
"args": [
|
||||
{
|
||||
"ident": "max"
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "users"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": {
|
||||
"name": "int64"
|
||||
},
|
||||
"table": "posts"
|
||||
},
|
||||
{
|
||||
"name": "user_id",
|
||||
"type": {
|
||||
"name": "int64"
|
||||
},
|
||||
"table": "posts"
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": {
|
||||
"name": "string",
|
||||
"nullable": true,
|
||||
"args": [
|
||||
{
|
||||
"int": 255
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "posts"
|
||||
},
|
||||
{
|
||||
"name": "created",
|
||||
"type": {
|
||||
"name": "timestamp"
|
||||
},
|
||||
"table": "posts"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"number": 1,
|
||||
"column": {
|
||||
"name": "name",
|
||||
"type": {
|
||||
"name": "string",
|
||||
"args": [
|
||||
{
|
||||
"ident": "max"
|
||||
}
|
||||
]
|
||||
},
|
||||
"table": "users"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user