Skip to content
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

fix: Override types of aliased columns and named parameters #1884

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

haines
Copy link
Contributor

@haines haines commented Oct 6, 2022

Fixes #606
Fixes #1752
Fixes #1864

Column type overriding fails when columns are aliased or parameter names do not match the underlying column.

This PR makes the compiler preserve the original column name if a column is aliased in a query or if a named parameter is used instead of a numbered one, and uses that name (if present) to check for a matching type override in the config.

@StevenACoffman
Copy link
Contributor

@haines Thanks for keeping this fresh! @kyleconroy We are using this patch and it is working well for us!

@haines
Copy link
Contributor Author

haines commented Feb 23, 2023

@kyleconroy could you please take a look?

Signed-off-by: Andrew Haines <andrew@haines.org.nz>
@kyleconroy kyleconroy merged commit 99ecfff into sqlc-dev:main Jun 7, 2023
@haines haines deleted the override-column-types branch June 8, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants