-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added an option to return resultsets as an array type. #1633
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.
I haven't dug too deep into the PR yet, but I think that the option should be specified for the individual query, rather than the entire connection. I'm OK with setting the default result for the entire connection, but being able to override that default on a per-query basis is necessary otherwise it'd be a lot of work to start using arrays in any existing code base.
@dougwilson It seems to be a good opinion. connection.query({
sql: 'SELECT ....',
rowsAsArray: true
}, function (err, rows) {
...
}); |
Hi @ifsnow sorry for the delay in feedback, I'm struggling a bit to download your pull request using |
@dougwilson I noticed there are some trouble in my fork. I can't find dresende's commits in mysqljs:master. (master...ifsnow:master) Perhaps these commits have been reset. I'll work on fixing it. Please wait a minute. |
@dougwilson I fixed my repository and created a new PR. |
This is for #770
You can use the
rowsAsArray
option to get the resultsets as an array type.I hope this helps.