mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-05-04 05:50:49 +00:00
30 lines
846 B
YAML
30 lines
846 B
YAML
# SQLC configuration for PentAGI database layer code generation
|
|
# Generates type-safe Go code from SQL queries and PostgreSQL schema
|
|
version: "2"
|
|
cloud:
|
|
|
|
sql:
|
|
- engine: "postgresql"
|
|
queries: ["models/*.sql"]
|
|
schema: ["../migrations/sql/*.sql"]
|
|
|
|
# Go code generation settings
|
|
gen:
|
|
go:
|
|
package: "database"
|
|
out: "../pkg/database"
|
|
sql_package: "database/sql"
|
|
emit_interface: true # Generate Querier interface for mocking
|
|
emit_json_tags: true # Add JSON tags to generated structs
|
|
|
|
# PostgreSQL to Go type mappings
|
|
overrides:
|
|
- db_type: "pg_catalog.numeric"
|
|
go_type: "float64"
|
|
- db_type: "bigint"
|
|
go_type: "int64"
|
|
|
|
# Database connection for sqlc analysis
|
|
database:
|
|
uri: ${DATABASE_URL}
|