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
31 lines (24 loc) · 817 Bytes
/
query.sql
File metadata and controls
31 lines (24 loc) · 817 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
28
29
30
31
CREATE TABLE foo (id int not null, name text not null, bar text null, mystr text not null);
/* 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'));
/* name: TypedMyStr :many */
SELECT bar FROM foo
WHERE mystr IN (sqlc.slice(mystr));