-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathsqlc.yaml
More file actions
62 lines (55 loc) · 2.16 KB
/
sqlc.yaml
File metadata and controls
62 lines (55 loc) · 2.16 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
version: "2"
sql:
- engine: "postgresql"
queries:
- ../../../riverpgxv5/internal/dbsqlc/pg_misc.sql
- ../../../riverpgxv5/internal/dbsqlc/river_job.sql
- ../../../riverpgxv5/internal/dbsqlc/river_leader.sql
- ../../../riverpgxv5/internal/dbsqlc/river_migration.sql
- ../../../riverpgxv5/internal/dbsqlc/river_queue.sql
- ../../../riverpgxv5/internal/dbsqlc/schema.sql
schema:
- ../../../riverpgxv5/internal/dbsqlc/pg_misc.sql
- ../../../riverpgxv5/internal/dbsqlc/river_job.sql
- ../../../riverpgxv5/internal/dbsqlc/river_leader.sql
- ../../../riverpgxv5/internal/dbsqlc/river_migration.sql
- ../../../riverpgxv5/internal/dbsqlc/river_queue.sql
- ../../../riverpgxv5/internal/dbsqlc/schema.sql
gen:
go:
package: "dbsqlc"
sql_package: "database/sql"
out: "."
emit_exact_table_names: true
emit_methods_with_db_argument: true
emit_params_struct_pointers: true
emit_result_struct_pointers: true
rename:
ids: "IDs"
ttl: "TTL"
overrides:
# `database/sql` really does not play nicely with json/jsonb. If it's
# left as `[]byte` or `json.RawMessage`, `database/sql` will try to
# encode it as binary (with a \x) which Postgres won't accept as
# json/jsonb at all. Using a custom struct crashed and burned, even
# with a custom scanner implementation. This is the only way I could
# get it to work: strings are compatible with our use of bytes slices,
# but Postgres will also accept them as json/jsonb.
- db_type: "jsonb"
go_type: "string"
- db_type: "pg_catalog.bit"
go_type: int
- db_type: "pg_catalog.bit"
go_type:
type: int
pointer: true
nullable: true
- db_type: "pg_catalog.interval"
go_type: "time.Duration"
- db_type: "timestamptz"
go_type: "time.Time"
- db_type: "timestamptz"
go_type:
type: "time.Time"
pointer: true
nullable: true