phase 0.3
This commit is contained in:
commit
4a94bfc4e7
52 changed files with 11653 additions and 0 deletions
43
sqlc.yaml
Normal file
43
sqlc.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
version: "2"
|
||||
sql:
|
||||
- engine: "mysql"
|
||||
schema: "sql/schema.sql"
|
||||
queries: "sql/queries.sql"
|
||||
gen:
|
||||
go:
|
||||
package: "db"
|
||||
out: "internal/db"
|
||||
sql_package: "database/sql"
|
||||
|
||||
# Emit a Querier interface so you can mock the DB layer in tests
|
||||
emit_interface: true
|
||||
|
||||
# Emit empty slices instead of nil for :many queries
|
||||
emit_empty_slices: true
|
||||
|
||||
# Add JSON tags to generated structs (useful for debugging / logging)
|
||||
emit_json_tags: true
|
||||
|
||||
# Keep struct names singular (airport not airports)
|
||||
emit_exact_table_names: false
|
||||
|
||||
# Expose the raw SQL strings (handy for logging slow queries)
|
||||
emit_exported_queries: true
|
||||
|
||||
# Override specific MySQL → Go type mappings
|
||||
overrides:
|
||||
# BIGINT UNSIGNED → uint64 (cash, experience_points)
|
||||
- db_type: "bigint unsigned"
|
||||
go_type: "uint64"
|
||||
|
||||
# INT UNSIGNED → uint32 (most IDs and resource fields)
|
||||
- db_type: "int unsigned"
|
||||
go_type: "uint32"
|
||||
|
||||
# SMALLINT UNSIGNED → uint16 (country / product IDs)
|
||||
- db_type: "smallint unsigned"
|
||||
go_type: "uint16"
|
||||
|
||||
# TINYINT UNSIGNED → uint8 (upgrade_tier)
|
||||
- db_type: "tinyint unsigned"
|
||||
go_type: "uint8"
|
||||
Loading…
Add table
Add a link
Reference in a new issue