forked from sqlc-dev/sqlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.sql
More file actions
27 lines (21 loc) · 704 Bytes
/
query.sql
File metadata and controls
27 lines (21 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
CREATE TABLE foo (id int not null, name text not null, bar text);
/* name: FuncParamIdent :many */
SELECT name FROM foo
WHERE name = sqlc.arg(slug)
AND id IN (sqlc.slice(favourites));
/* name: FuncParamString :many */
SELECT name FROM foo
WHERE name = sqlc.arg('slug')
AND id IN (sqlc.slice('favourites'));
/* name: FuncParamSoloArg :many */
SELECT name FROM foo
WHERE id IN (sqlc.slice('favourites'));
/* name: SliceExec :exec */
UPDATE foo SET name = sqlc.arg(slug)
WHERE id IN (sqlc.slice(favourites));
/* name: FuncNullable :many */
SELECT bar FROM foo
WHERE id IN (sqlc.slice('favourites'));
/* name: FuncNullableNot :many */
SELECT bar FROM foo
WHERE id NOT IN (sqlc.slice('favourites'));