-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsqlc.yaml
43 lines (36 loc) · 1.68 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
# version: "1"
# packages:
# - name: "generated_db"
# path: "./db/sqlc"
# queries: "./db/query/"
# schema: "./db/migration/"
# engine: "postgresql"
# emit_json_tags: true
# emit_prepared_queries: false
# emit_interface: false
# emit_exact_table_names: false
version: "2"
cloud:
project: "backend-masterclass-go"
sql:
- engine: "postgresql"
queries: "./db/query/" # Directory of SQL queries or path to single SQL file; or a list of paths.
schema: "./db/migrations/" # Directory of SQL migrations or path to single SQL file; or a list of paths.
# https://docs.sqlc.dev/en/latest/reference/config.html#gen
gen:
go:
package: "generated_db" # The go package name that will be generated. Defaults to out basename.
out: "./db/sqlc" # Output directory for generated code.
sql_package: "database/sql" # The package name of the database package. Defaults to "database/sql".
# If true, include support for prepared queries. Defaults to false
emit_prepared_queries: false
# If true, output a Querier interface in the generated package. Defaults to false.
emit_interface: true
# If true, struct names will mirror table names. Otherwise, sqlc attempts
# to singularize plural table names. Defaults to false
emit_exact_table_names: false
# If true, add JSON tags to generated structs. Defaults to false.
emit_json_tags: true
# If true, slices returned by :many queries will be empty instead
# of nil. Defaults to false.
emit_empty_slices: true