-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
What is the correct syntax for including SQL values AND rowsAsArray option in a query? #3130
Comments
Thanks, @millerbryan 🤝 Based on the types, there are two ways to use it:
// A
pool.query({ sql: '', values: [], rowsAsArray: true });
// B
pool.query({ sql: '', rowsAsArray: true }, []); I'll check it out in practice and also what happens if both are used at the same time with different values:
pool.query({ sql: '', values: [], rowsAsArray: true }, []); |
Thank you @wellwelwel and apologies for missing your response. I will have a go at your syntax now and see what happens. |
Discussed in #3095
This is really a documentation enhancement request and should not be moved to a discussion.
There is no place in the docs where the correct syntax for using both
rowsAsArray
and a SQL value is shown.Originally posted by millerbryan October 2, 2024
I've looked at all the examples in the docs which use
rowsAsArray
and it isn't clear how to specify it in a query (rather than in the connection) when passing in SQL values. Is this possible to pass both?The text was updated successfully, but these errors were encountered: