-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlc.yaml
More file actions
85 lines (80 loc) · 2.37 KB
/
sqlc.yaml
File metadata and controls
85 lines (80 loc) · 2.37 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: '2'
sql:
- engine: postgresql
schema: internal/db/migrations
queries: internal/db/queries
gen:
go:
package: sqlc
out: internal/db/sqlc
sql_package: 'pgx/v5'
emit_pointers_for_null_types: true
emit_json_tags: true
emit_db_tags: true
emit_interface: false
overrides:
# timestamptz to time.Time (pgx compatible)
- db_type: 'timestamptz'
nullable: true
go_type:
type: 'time.Time'
pointer: true
- db_type: 'timestamptz'
nullable: false
go_type:
type: 'time.Time'
# double precision to float64
- db_type: 'double precision'
nullable: false
go_type:
type: 'float64'
- db_type: 'double precision'
nullable: true
go_type:
type: 'float64'
pointer: true
# int to int32
- db_type: 'pg_catalog.int4'
nullable: false
go_type:
type: 'int32'
- db_type: 'pg_catalog.int4'
nullable: true
go_type:
type: 'int32'
pointer: true
# pg uuid to google/uuid
- db_type: 'uuid'
nullable: false
go_type:
import: 'github.com/google/uuid'
type: 'UUID'
- db_type: 'uuid'
nullable: true
go_type:
import: 'github.com/google/uuid'
type: 'UUID'
pointer: true
# date to time.Time
- db_type: 'date'
nullable: false
go_type:
type: 'time.Time'
- db_type: 'date'
nullable: true
go_type:
type: 'time.Time'
pointer: true
# map columns directly to proto enums
- column: 'accounts.account_type'
go_type:
import: 'null-core/internal/gen/null/v1'
type: 'AccountType'
- column: 'transactions.tx_direction'
go_type:
import: 'null-core/internal/gen/null/v1'
type: 'TransactionDirection'
- column: 'receipts.status'
go_type:
import: 'null-core/internal/gen/null/v1'
type: 'ReceiptStatus'