-
Notifications
You must be signed in to change notification settings - Fork 809
/
sqlc.yaml
52 lines (52 loc) · 1.16 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
version: '2'
cloud:
project: "01HAQMMECEYQYKFJN8MP16QC41"
sql:
- name: postgresql
schema: postgresql/schema.sql
queries: postgresql/query.sql
engine: postgresql
database:
uri: "${VET_TEST_EXAMPLES_POSTGRES_AUTHORS}"
analyzer:
database: false
rules:
- sqlc/db-prepare
- postgresql-query-too-costly
gen:
go:
package: authors
sql_package: pgx/v5
out: postgresql
- name: mysql
schema: mysql/schema.sql
queries: mysql/query.sql
engine: mysql
database:
uri: "${VET_TEST_EXAMPLES_MYSQL_AUTHORS}"
rules:
- sqlc/db-prepare
# - mysql-query-too-costly
gen:
go:
package: authors
out: mysql
- name: sqlite
schema: sqlite/schema.sql
queries: sqlite/query.sql
engine: sqlite
database:
uri: file:authors?mode=memory&cache=shared
rules:
- sqlc/db-prepare
gen:
go:
package: authors
out: sqlite
rules:
- name: postgresql-query-too-costly
message: "Too costly"
rule: "postgresql.explain.plan.total_cost > 300.0"
- name: mysql-query-too-costly
message: "Too costly"
rule: "has(mysql.explain.query_block.cost_info) && double(mysql.explain.query_block.cost_info.query_cost) > 2.0"