-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add multi-query transaction support to snowflake piece #92
base: main
Are you sure you want to change the base?
feat: add multi-query transaction support to snowflake piece #92
Conversation
522e748
to
0f20e53
Compare
'Array of SQL queries to execute in order, in the same transaction. Use :1, :2… or ? placeholders to use binding parameters.', | ||
required: true, | ||
}), | ||
binds: Property.Array({ |
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 binds are shared across all queries
- does it work if 1 query does not use all the binds? no error?
- does snowflake support named binding params? to avoid any surprise
- using
?
seems dangerous, at least:1
:2
etc. should be deterministic - we should at least update the description to nudge towards the best practice
Have you tested a few different scenarios?
If we don't have an easy solution to prevent such mistakes, an alternative would be to have binds per query - it's a bit more complex but totally possible (Property.Array
can be more complex)
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.
Re. named params, looks like the answer is no:
https://stackoverflow.com/questions/76814603/how-can-i-use-named-binding-in-nodejs-while-pulling-data-from-snowflake
(not surprising, I had checked last year already)
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.
does it work if 1 query does not use all the binds? no error?
yes
Have you tested a few different scenarios?
Tested combinations:
- Unused binds
- All binds used by query number 1
- Multiple binds in a query
- Single bind in a query
- Different query, different bind (Query 1 uses bind 1, Query 2 uses bind 2)
- Int binds
- String binds
Did I miss anything?
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.
If we don't have an easy solution to prevent such mistakes, an alternative would be to have binds per query
I find the way it currently works pretty clear. 🤔 I mean, it works as we could naively expect it to work.
I've updated the description btw.
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 could probably ask the AP team for advice about this WDYT?
0f20e53
to
bef5b0d
Compare
What does this PR do?
Enhances the Snowflake piece's query execution capabilities by: