chore: put overrides and renames in pkg context in sqlc.yaml (#11347)

* chore: Put overrides and renames in pkg context in sqlc.yaml

---------

Co-authored-by: Andrew Benton <andrewmbenton@gmail.com>
This commit is contained in:
Steven Masley
2024-01-02 03:56:38 -05:00
committed by GitHub
parent 36636bb6a5
commit 8f49f10134

View File

@ -5,10 +5,27 @@ version: "2"
cloud:
# This is the static ID for the coder project.
project: "01HEP08N3WKWRFZT3ZZ9Q37J8X"
# Ideally renames & overrides would go under the sql section, but there is a
# bug in sqlc that only global renames & overrides are currently being applied.
overrides:
sql:
- schema: "./dump.sql"
queries: "./queries"
engine: "postgresql"
# This only works if you are running a local postgres database with the
# schema loaded and migrations run. Run `make sqlc-vet` to run the linter.
database:
uri: "${SQLC_DATABASE_URL}"
analyzer:
database: false
rules:
- sqlc/db-prepare
gen:
go:
package: "database"
out: "./queries"
emit_interface: true
emit_json_tags: true
emit_db_tags: true
emit_enum_valid_method: true
emit_all_enum_values: true
overrides:
- column: "provisioner_daemons.tags"
go_type:
@ -83,25 +100,3 @@ overrides:
oauth2_provider_app: OAuth2ProviderApp
oauth2_provider_app_secret: OAuth2ProviderAppSecret
callback_url: CallbackURL
sql:
- schema: "./dump.sql"
queries: "./queries"
engine: "postgresql"
# This only works if you are running a local postgres database with the
# schema loaded and migrations run. Run `make sqlc-vet` to run the linter.
database:
uri: "${SQLC_DATABASE_URL}"
analyzer:
database: false
rules:
- sqlc/db-prepare
gen:
go:
package: "database"
out: "./queries"
emit_interface: true
emit_json_tags: true
emit_db_tags: true
emit_enum_valid_method: true
emit_all_enum_values: true