|
1 | 1 | # sqlc is used to generate types from sql schema language.
|
2 | 2 | # It was chosen to ensure type-safety when interacting with
|
3 | 3 | # the database.
|
4 |
| -version: "1" |
5 |
| -packages: |
6 |
| - - name: "database" |
7 |
| - path: "./queries" |
8 |
| - queries: "./queries" |
9 |
| - schema: "./dump.sql" |
10 |
| - engine: "postgresql" |
11 |
| - emit_interface: true |
12 |
| - emit_json_tags: true |
13 |
| - emit_db_tags: true |
14 |
| - # We replace the generated db file with our own |
15 |
| - # to add support for transactions. This file is |
16 |
| - # deleted after generation. |
17 |
| - output_db_file_name: db_tmp.go |
18 |
| - |
| 4 | +version: "2" |
| 5 | +# Ideally renames & overrides would go under the sql section, but there is a |
| 6 | +# bug in sqlc that only global renames & overrides are currently being applied. |
19 | 7 | overrides:
|
20 |
| - - column: "provisioner_daemons.tags" |
21 |
| - go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap" |
22 |
| - - column: "provisioner_jobs.tags" |
23 |
| - go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap" |
24 |
| - - column: "users.rbac_roles" |
25 |
| - go_type: "github.com/lib/pq.StringArray" |
26 |
| - - column: "templates.user_acl" |
27 |
| - go_type: |
28 |
| - type: "TemplateACL" |
29 |
| - - column: "templates.group_acl" |
30 |
| - go_type: |
31 |
| - type: "TemplateACL" |
| 8 | + go: |
| 9 | + overrides: |
| 10 | + - column: "provisioner_daemons.tags" |
| 11 | + go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap" |
| 12 | + - column: "provisioner_jobs.tags" |
| 13 | + go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap" |
| 14 | + - column: "users.rbac_roles" |
| 15 | + go_type: "github.com/lib/pq.StringArray" |
| 16 | + - column: "templates.user_acl" |
| 17 | + go_type: |
| 18 | + type: "TemplateACL" |
| 19 | + - column: "templates.group_acl" |
| 20 | + go_type: |
| 21 | + type: "TemplateACL" |
| 22 | + rename: |
| 23 | + api_key: APIKey |
| 24 | + api_key_scope: APIKeyScope |
| 25 | + api_key_scope_all: APIKeyScopeAll |
| 26 | + api_key_scope_application_connect: APIKeyScopeApplicationConnect |
| 27 | + avatar_url: AvatarURL |
| 28 | + login_type_oidc: LoginTypeOIDC |
| 29 | + oauth_access_token: OAuthAccessToken |
| 30 | + oauth_expiry: OAuthExpiry |
| 31 | + oauth_id_token: OAuthIDToken |
| 32 | + oauth_refresh_token: OAuthRefreshToken |
| 33 | + parameter_type_system_hcl: ParameterTypeSystemHCL |
| 34 | + userstatus: UserStatus |
| 35 | + gitsshkey: GitSSHKey |
| 36 | + rbac_roles: RBACRoles |
| 37 | + ip_address: IPAddress |
| 38 | + ip_addresses: IPAddresses |
| 39 | + ids: IDs |
| 40 | + jwt: JWT |
| 41 | + user_acl: UserACL |
| 42 | + group_acl: GroupACL |
| 43 | + troubleshooting_url: TroubleshootingURL |
| 44 | + default_ttl: DefaultTTL |
| 45 | + motd_file: MOTDFile |
32 | 46 |
|
33 |
| -rename: |
34 |
| - api_key: APIKey |
35 |
| - api_key_scope: APIKeyScope |
36 |
| - api_key_scope_all: APIKeyScopeAll |
37 |
| - api_key_scope_application_connect: APIKeyScopeApplicationConnect |
38 |
| - avatar_url: AvatarURL |
39 |
| - login_type_oidc: LoginTypeOIDC |
40 |
| - oauth_access_token: OAuthAccessToken |
41 |
| - oauth_expiry: OAuthExpiry |
42 |
| - oauth_id_token: OAuthIDToken |
43 |
| - oauth_refresh_token: OAuthRefreshToken |
44 |
| - parameter_type_system_hcl: ParameterTypeSystemHCL |
45 |
| - userstatus: UserStatus |
46 |
| - gitsshkey: GitSSHKey |
47 |
| - rbac_roles: RBACRoles |
48 |
| - ip_address: IPAddress |
49 |
| - ip_addresses: IPAddresses |
50 |
| - ids: IDs |
51 |
| - jwt: JWT |
52 |
| - user_acl: UserACL |
53 |
| - group_acl: GroupACL |
54 |
| - troubleshooting_url: TroubleshootingURL |
55 |
| - default_ttl: DefaultTTL |
56 |
| - motd_file: MOTDFile |
| 47 | +sql: |
| 48 | + - schema: "./dump.sql" |
| 49 | + queries: "./queries" |
| 50 | + engine: "postgresql" |
| 51 | + gen: |
| 52 | + go: |
| 53 | + package: "database" |
| 54 | + out: "./queries" |
| 55 | + emit_interface: true |
| 56 | + emit_json_tags: true |
| 57 | + emit_db_tags: true |
0 commit comments