Skip to content

Support glob patterns in column name for overrides #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kyleconroy opened this issue Mar 26, 2020 · 0 comments
Closed

Support glob patterns in column name for overrides #418

kyleconroy opened this issue Mar 26, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@kyleconroy
Copy link
Collaborator

I have the following sqlc.yaml file in my project:

version: "1"
packages:
  - path: db
    emit_prepared_queries: true
    schema: sql/schema.sql
    queries: sql/query.sql
overrides:
  - column: "organizations.id"
    go_type: "github.com/segmentio/ksuid.KSUID"
  - column: "projects.id"
    go_type: "github.com/segmentio/ksuid.KSUID"
  - column: "projects.organization_id"
    go_type: "github.com/segmentio/ksuid.KSUID"

It would be really nice If I could the following two lines to override all columns named id and all columns ending in _id.

version: "1"
packages:
  - path: db
    emit_prepared_queries: true
    schema: sql/schema.sql
    queries: sql/query.sql
overrides:
  - column: "id"
    go_type: "github.com/segmentio/ksuid.KSUID"
  - column: "*_id"
    go_type: "github.com/segmentio/ksuid.KSUID"
@kyleconroy kyleconroy added the enhancement New feature or request label Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant