Repository navigation
Expand file tree
/
Copy pathsqlc.yaml
More file actions
71 lines (71 loc) · 2.03 KB
/
Copy pathsqlc.yaml
File metadata and controls
71 lines (71 loc) · 2.03 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
version: "2"
sql:
- engine: postgresql
schema: db/migrations
queries: db/queries
gen:
go:
package: database
out: pkg/database
sql_package: pgx/v5
# Row structs are named *Row so they are not mistaken for the API
# types of the same name; a store layer converts between the two.
rename:
project: ProjectRow
stage: StageRow
promotion: PromotionRow
target: TargetRow
promotion_freight: PromotionFreightRow
promotion_rollout: PromotionRolloutRow
promotion_rollout_target: PromotionRolloutTargetRow
promotion_rollout_freight: PromotionRolloutFreightRow
overrides:
# Labels are a string map and params an object of opaque JSON values,
# both enforced by the schema. pgx encodes and decodes JSONB through
# encoding/json for any Go type.
- column: targets.labels
go_type:
type: map[string]string
- column: targets.params
go_type:
import: encoding/json
type: RawMessage
- column: stages.target_selectors
go_type:
import: encoding/json
type: RawMessage
- column: promotion_rollout_freight.reference
go_type:
import: encoding/json
type: RawMessage
- db_type: timestamptz
go_type:
import: time
type: Time
- db_type: uuid
go_type:
import: github.com/google/uuid
type: UUID
# Nullable values, such as optional query arguments, are pointers.
- db_type: text
nullable: true
go_type:
type: string
pointer: true
- db_type: timestamptz
nullable: true
go_type:
import: time
type: Time
pointer: true
- db_type: uuid
nullable: true
go_type:
import: github.com/google/uuid
type: UUID
pointer: true
- db_type: pg_catalog.int8
nullable: true
go_type:
type: int64
pointer: true