mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: Upgrade to sqlc version 2 yaml configuration (#5442)
* chore: Upgrade to sqlc version 2 yaml configuration
This commit is contained in:
@ -1,21 +1,11 @@
|
|||||||
# sqlc is used to generate types from sql schema language.
|
# sqlc is used to generate types from sql schema language.
|
||||||
# It was chosen to ensure type-safety when interacting with
|
# It was chosen to ensure type-safety when interacting with
|
||||||
# the database.
|
# the database.
|
||||||
version: "1"
|
version: "2"
|
||||||
packages:
|
# Ideally renames & overrides would go under the sql section, but there is a
|
||||||
- name: "database"
|
# bug in sqlc that only global renames & overrides are currently being applied.
|
||||||
path: "./queries"
|
overrides:
|
||||||
queries: "./queries"
|
go:
|
||||||
schema: "./dump.sql"
|
|
||||||
engine: "postgresql"
|
|
||||||
emit_interface: true
|
|
||||||
emit_json_tags: true
|
|
||||||
emit_db_tags: true
|
|
||||||
# We replace the generated db file with our own
|
|
||||||
# to add support for transactions. This file is
|
|
||||||
# deleted after generation.
|
|
||||||
output_db_file_name: db_tmp.go
|
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
- column: "provisioner_daemons.tags"
|
- column: "provisioner_daemons.tags"
|
||||||
go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap"
|
go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap"
|
||||||
@ -29,7 +19,6 @@ overrides:
|
|||||||
- column: "templates.group_acl"
|
- column: "templates.group_acl"
|
||||||
go_type:
|
go_type:
|
||||||
type: "TemplateACL"
|
type: "TemplateACL"
|
||||||
|
|
||||||
rename:
|
rename:
|
||||||
api_key: APIKey
|
api_key: APIKey
|
||||||
api_key_scope: APIKeyScope
|
api_key_scope: APIKeyScope
|
||||||
@ -54,3 +43,15 @@ rename:
|
|||||||
troubleshooting_url: TroubleshootingURL
|
troubleshooting_url: TroubleshootingURL
|
||||||
default_ttl: DefaultTTL
|
default_ttl: DefaultTTL
|
||||||
motd_file: MOTDFile
|
motd_file: MOTDFile
|
||||||
|
|
||||||
|
sql:
|
||||||
|
- schema: "./dump.sql"
|
||||||
|
queries: "./queries"
|
||||||
|
engine: "postgresql"
|
||||||
|
gen:
|
||||||
|
go:
|
||||||
|
package: "database"
|
||||||
|
out: "./queries"
|
||||||
|
emit_interface: true
|
||||||
|
emit_json_tags: true
|
||||||
|
emit_db_tags: true
|
||||||
|
Reference in New Issue
Block a user