-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlc.yaml
More file actions
36 lines (36 loc) · 1.09 KB
/
sqlc.yaml
File metadata and controls
36 lines (36 loc) · 1.09 KB
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: "internal/database/queries"
schema: "database/migrations"
gen:
go:
package: "sqlc"
out: "internal/database/sqlc"
sql_package: "pgx/v5"
emit_json_tags: true
emit_prepared_queries: false
emit_interface: true
emit_exact_table_names: false
emit_empty_slices: true
overrides:
# UUID type
- db_type: "uuid"
go_type: "github.com/google/uuid.UUID"
# Numeric/Decimal - for money and rates
- db_type: "pg_catalog.numeric"
go_type: "github.com/shopspring/decimal.Decimal"
# Date type (for transaction_date, exchange rate date)
- db_type: "pg_catalog.date"
go_type:
import: "time"
type: "Time"
# Timestamp types
- db_type: "pg_catalog.timestamptz"
go_type:
import: "time"
type: "Time"
- db_type: "pg_catalog.timestamp"
go_type:
import: "time"
type: "Time"