Private
Public Access
1
0
Files
data-api/sqlc.yaml
Ask Bjørn Hansen c9481d12c6
All checks were successful
continuous-integration/drone/push Build is passing
feat(db): migrate from MySQL to PostgreSQL
Replace MySQL driver with pgx/v5 and pgxpool:
- Update sqlc to use postgresql engine
- Convert query.sql to PostgreSQL syntax ($1 params, CASE WHEN,
  ANY() arrays)
- Replace sql.DB with pgxpool.Pool throughout
- Change nullable types from sql.Null* to pgtype.*
- Update ID types from uint32 to int64 for PostgreSQL compatibility
- Delete MySQL-specific dynamic_connect.go
- Add opentelemetry.gowrap template for tracing
2025-11-29 10:59:15 -08:00

27 lines
726 B
YAML

version: "2"
sql:
- schema: "schema.sql"
queries: "query.sql"
engine: "postgresql"
strict_order_by: false
gen:
go:
package: "ntpdb"
out: "ntpdb"
sql_package: "pgx/v5"
emit_json_tags: true
emit_db_tags: true
omit_unused_structs: true
emit_interface: true
rename:
servers.Ip: IP
overrides:
- column: log_scores.attributes
go_type: go.ntppool.org/common/types.LogScoreAttributes
- column: "server_netspeed.netspeed_active"
go_type: "int"
- column: "zone_server_counts.netspeed_active"
go_type: "int"
- db_type: "bigint"
go_type: "int"