-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsqlc.yaml
More file actions
30 lines (30 loc) · 1.25 KB
/
sqlc.yaml
File metadata and controls
30 lines (30 loc) · 1.25 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
version: "2"
sql:
- engine: "postgresql"
queries: "db/queries"
schema: "db/migrations/postgres"
gen:
go:
package: "dbsqlc"
out: "internal/dbsqlc"
# Phase-3 §3.1: switched from pgx/v5 to database/sql so the
# generated Queries surface plugs into the existing *sql.DB
# pool on postgres.Store without a parallel pgxpool. We keep
# pgx as the underlying driver (registered via pgx/v5/stdlib);
# this change only affects the *types* sqlc emits for rows
# and parameters.
sql_package: "database/sql"
emit_pointers_for_null_types: true
overrides:
# The only nullable JSONB column in the schema. Mapping it to
# json.RawMessage matches every other JSONB column in the
# codebase (audit_events.details, jobs.payload, etc.) and avoids
# pulling in github.com/sqlc-dev/pqtype just for one column:
# database/sql scans SQL NULL into a nil json.RawMessage
# natively and accepts a nil json.RawMessage as a NULL parameter.
- column: "enrollment_events.fields_json"
go_type:
import: "encoding/json"
type: "RawMessage"
pointer: true
nullable: true