-
Notifications
You must be signed in to change notification settings - Fork 5
Auto-generated insert procedures v1 #261
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
Conversation
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.
The implementation seems fine, I just have a couple of nitpicks.
CASE WHEN attgenerated_exists | ||
THEN CASE WHEN attgenerated::text = 's' THEN 'isGenerated' ELSE 'notGenerated' END | ||
ELSE 'notGenerated' | ||
END as is_generated |
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 like a strange way to implement booleans. Why not true
and false
?
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.
Just liked being explicit, wouldn't mind changing it to bool if you want me to.
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.
Makes me uneasy because there's the potential of many values here, rather than the two we care about.
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.
I've changed this so instead of returning isGenerated
, it will return stored
, so that if and when postgres adds additional values to this, it will be strictly additive.
crates/query-engine/translation/src/translation/mutation/insert.rs
Outdated
Show resolved
Hide resolved
87308c9
to
cc8b272
Compare
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.
a v1 config snapshot! Generated because we added a new table (custom.dog).
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.
Looks good to me
What
We'd like to auto-generate insert procedures for tables.
How
Soon, tl;dr:
todo: add engine metadata for
v1_insert_custom_dog
.