-
Notifications
You must be signed in to change notification settings - Fork 127
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 generated columns in mutable columns for PostgreSQL #210
fix generated columns in mutable columns for PostgreSQL #210
Conversation
Need data from go-jet/jet-test-data#3 |
LGTM. I've merged test data PR. To fix this PR build you'll need to push one more commit, with updated sub-module master head. You can just call |
CircleCI didn't take the new link to jet-test-data. Did I miss something? |
I cannot restart the CI myself. |
Ahh, sorry I missed this. |
generator/postgres/query_set.go
Outdated
@@ -44,6 +44,7 @@ WITH primaryKeys AS ( | |||
) | |||
SELECT column_name as "column.Name", | |||
is_nullable = 'YES' as "column.isNullable", | |||
is_generated = 'ALWAYS' as "column.isGenerated", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to update this condition since cockroachdb
doesn't use ALWAYS
but YES
as a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example in the code where we send one way for PostgreSQL and another way for CockroachDB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query is used for both databases. Cockroach shares interfaces with postgres, but there are occasionally some differences. So we just have to add: is_generated = 'ALWAYS' or is_generated = 'YES'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok in local tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks good.
@go-jet Thank you 🥳 |
Fix #209