1f35b7eea4
# Conflicts: # internal/db/db.go
38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
version: "2"
|
|
|
|
# sqlc generates typed Go for the queries in internal/db/queries, checking each
|
|
# one against the real schema at build time. Schema and queries are plain SQL so
|
|
# `sqlc generate` is the only step: no ORM, no DSL.
|
|
#
|
|
# Pilot scope: the read paths behind the MCP tools. Add queries incrementally;
|
|
# hand-written database/sql stays valid for everything not yet migrated.
|
|
sql:
|
|
- engine: "sqlite"
|
|
schema: "internal/db/schema.sql"
|
|
queries: "internal/db/queries"
|
|
gen:
|
|
go:
|
|
package: "sqlcdb"
|
|
out: "internal/db/sqlcdb"
|
|
emit_interface: false
|
|
emit_json_tags: false
|
|
emit_empty_slices: true
|
|
# models.go otherwise gains an EntriesFt struct for the FTS5 virtual
|
|
# table, which sqlc cannot query anyway.
|
|
omit_unused_structs: true
|
|
overrides:
|
|
# FTS5 and COALESCE keep columns NOT NULL in practice; sqlc infers
|
|
# nullable types from the DDL, so pin the ones the schema defaults.
|
|
- column: "entries.source_path"
|
|
go_type: "string"
|
|
- column: "entries.project"
|
|
go_type: "string"
|
|
- column: "entries.content_type"
|
|
go_type: "string"
|
|
- column: "entries.title"
|
|
go_type: "string"
|
|
- column: "entries.summary"
|
|
go_type: "string"
|
|
- column: "entries.created_at"
|
|
go_type: "string"
|