-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlc.yaml
More file actions
28 lines (28 loc) · 788 Bytes
/
sqlc.yaml
File metadata and controls
28 lines (28 loc) · 788 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
version: "2"
sql:
- engine: "postgresql"
queries: "assets/queries.sql"
schema: "assets/migrations/"
gen:
go:
sql_package: "pgx/v5"
package: "db"
out: "lib/db"
emit_json_tags: true
emit_empty_slices: true
overrides:
- column: "rotas.metadata"
go_type:
type: "RotaMetadata"
- column: "members.metadata"
go_type:
type: "MemberMetadata"
database:
uri: "postgresql://rotabot@localhost:5432/rotabot?sslmode=disable"
rules:
- sqlc/db-prepare
- has-index
rules:
- name: has-index
rule: >
query.sql.startsWith("SELECT") && !(postgresql.explain.plan.plans.all(p, has(p.index_name) || p.plans.all(p, has(p.index_name))))