Skip to content

gen: Ignore empty override settings#128

Merged
kyleconroy merged 1 commit intomasterfrom
override-check
Nov 7, 2019
Merged

gen: Ignore empty override settings#128
kyleconroy merged 1 commit intomasterfrom
override-check

Conversation

@kyleconroy
Copy link
Copy Markdown
Collaborator

The previous goInnerType assumed that the column name and table would
be non-empty. For computed columns, this is not true. Make sure to check
if the override setting (PostgresType or Column) is non-empty before
applying an override.

I discovered this with a query that was cast a parameter to a boolean. The generated code assigned the parameter a type of uuid.UUID.

SELECT * from authors
WHERE $3::bool
ORDER BY id
LIMIT $2;

The previous `goInnerType` assumed that the column name and table would
be non-empty. For computed columns, this is not true. Make sure to check
if the override setting (PostgresType or Column) is non-empty before
applying an override.
@kyleconroy kyleconroy merged commit 0f39706 into master Nov 7, 2019
@kyleconroy kyleconroy deleted the override-check branch November 7, 2019 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant