-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqlc.yaml
158 lines (145 loc) · 4.11 KB
/
sqlc.yaml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: "2"
rules:
- name: "always-order-by"
rule: |
query.cmd == "many" && !query.sql.contains("ORDER BY")
message: |
SELECT statements must have an ORDER BY clause
sql:
- &default_domain
name: "Users SQL"
engine: "postgresql"
schema: "../internal/database/migrations"
queries: "../internal/user/queries"
rules:
- "always-order-by"
gen:
go: &default_go
package: "usersql"
out: "../internal/user/usersql"
sql_package: "pgx/v5"
emit_interface: true
emit_result_struct_pointers: true
emit_prepared_queries: true
emit_all_enum_values: true
emit_enum_valid_method: true
emit_pointers_for_null_types: true
emit_empty_slices: true
json_tags_id_uppercase: true
omit_unused_structs: true
omit_sqlc_version: true
overrides:
- db_type: "slug"
go_type: "*github.com/nais/api/internal/slug.Slug"
nullable: true
- db_type: "slug"
go_type: "github.com/nais/api/internal/slug.Slug"
- db_type: "uuid"
go_type: "*github.com/google/uuid.UUID"
nullable: true
- db_type: "uuid"
go_type: "github.com/google/uuid.UUID"
- <<: *default_domain
name: "Service accounts SQL"
queries: "../internal/serviceaccount/queries"
gen:
go:
<<: *default_go
package: "serviceaccountsql"
out: "../internal/serviceaccount/serviceaccountsql"
- <<: *default_domain
name: "Teams SQL"
queries: "../internal/team/queries"
gen:
go:
<<: *default_go
package: "teamsql"
out: "../internal/team/teamsql"
- <<: *default_domain
name: "Roles SQL"
queries: "../internal/role/queries"
gen:
go:
<<: *default_go
package: "rolesql"
out: "../internal/role/rolesql"
- <<: *default_domain
name: "Activity log SQL"
queries: "../internal/activitylog/queries"
gen:
go:
<<: *default_go
package: "activitylogsql"
out: "../internal/activitylog/activitylogsql"
- <<: *default_domain
name: "GitHub repositories SQL"
queries: "../internal/github/repository/queries"
gen:
go:
<<: *default_go
package: "repositorysql"
out: "../internal/github/repository/repositorysql"
- <<: *default_domain
name: "Cost SQL"
queries: "../internal/cost/queries"
gen:
go:
<<: *default_go
package: "costsql"
out: "../internal/cost/costsql"
- <<: *default_domain
name: "Reconciler SQL"
queries: "../internal/reconciler/queries"
gen:
go:
<<: *default_go
package: "reconcilersql"
out: "../internal/reconciler/reconcilersql"
- <<: *default_domain
name: "Environment SQL"
queries: "../internal/environment/queries"
gen:
go:
<<: *default_go
package: "environmentsql"
out: "../internal/environment/environmentsql"
- <<: *default_domain
name: "Teams SQL for gRPC"
queries: "../internal/grpc/grpcteam/queries"
gen:
go:
<<: *default_go
package: "grpcteamsql"
out: "../internal/grpc/grpcteam/grpcteamsql"
- <<: *default_domain
name: "Users SQL for gRPC"
queries: "../internal/grpc/grpcuser/queries"
gen:
go:
<<: *default_go
package: "grpcusersql"
out: "../internal/grpc/grpcuser/grpcusersql"
- <<: *default_domain
name: "Reconcilers SQL for gRPC"
queries: "../internal/grpc/grpcreconciler/queries"
gen:
go:
<<: *default_go
package: "grpcreconcilersql"
out: "../internal/grpc/grpcreconciler/grpcreconcilersql"
- <<: *default_domain
name: "Usersync SQL"
queries: "../internal/usersync/queries"
gen:
go:
<<: *default_go
package: "usersyncsql"
out: "../internal/usersync/usersyncsql"
- <<: *default_domain
name: "Session SQL"
queries: "../internal/session/queries"
gen:
go:
<<: *default_go
package: "sessionsql"
out: "../internal/session/sessionsql"