tonyslist/sqlc.yaml

47 lines
1.4 KiB
YAML

version: "2"
sql:
- engine: "sqlite"
schema: "db/migrations"
queries: "db/queries"
gen:
go:
out: "pkg/models/sqlc"
emit_db_tags: true
overrides:
go:
overrides:
- db_type: "integer"
go_type:
type: "int"
- db_type: "integer"
go_type:
type: "NullInt"
import: "git.grosinger.net/tgrosinger/tonyslist/pkg/conv"
nullable: true
# sqlc bug requires specifying the schema
# https://github.com/kyleconroy/sqlc/pull/1986
- column: "main.posts_base.post_type"
go_type:
type: "PostType"
import: "git.grosinger.net/tgrosinger/tonyslist/constants"
- column: "main.classifieds.classified_type"
go_type:
type: "ClassifiedType"
import: "git.grosinger.net/tgrosinger/tonyslist/constants"
- column: "main.housing.housing_type"
go_type:
type: "HousingType"
import: "git.grosinger.net/tgrosinger/tonyslist/constants"
- column: "main.events.start_time"
go_type:
type: "Time"
import: "time"
- column: "main.events.end_time"
go_type:
type: "NullTime"
import: "database/sql"
- column: "main.stats.name"
go_type:
type: "StatName"
import: "git.grosinger.net/tgrosinger/tonyslist/constants"