-
Notifications
You must be signed in to change notification settings - Fork 3
/
sqlc.yaml
36 lines (36 loc) · 1.3 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
version: '2'
sql:
- engine: 'postgresql'
queries:
- './sql/queries/api-key.sql'
- './sql/queries/application.sql'
- './sql/queries/project-invitation.sql'
- './sql/queries/project.sql'
- './sql/queries/prompt-config.sql'
- './sql/queries/prompt-request-record.sql'
- './sql/queries/prompt-test-record.sql'
- './sql/queries/provider-key.sql'
- './sql/queries/provider-model-pricing.sql'
- './sql/queries/user-account.sql'
- './sql/queries/user-project.sql'
schema: './sql/schema.sql'
database:
uri: postgresql://basemind:basemind@localhost:5432/basemind
rules:
- sqlc/db-prepare
- postgresql-query-too-costly
- postgresql-no-seq-scan
gen:
go:
package: 'models'
out: 'shared/go/db/models'
sql_package: 'pgx/v5'
emit_json_tags: true
json_tags_case_style: camel
rules:
- name: postgresql-query-too-costly
message: 'Query cost estimate is too high'
rule: 'postgresql.explain.plan.total_cost > 25.0'
- name: postgresql-no-seq-scan
message: 'Query plan results in a sequential scan'
rule: "postgresql.explain.plan.node_type == 'Seq Scan'"