Skip to content

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

Closed
wants to merge 8 commits into from
Closed

Added an option to return resultsets as an array type. #1633

wants to merge 8 commits into from

Conversation

ifsnow
Copy link
Contributor

@ifsnow ifsnow commented Jan 29, 2017

This is for #770

You can use the rowsAsArray option to get the resultsets as an array type.
I hope this helps.

Copy link
Member

@dougwilson dougwilson left a 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 dougwilson self-assigned this Jan 29, 2017
@ifsnow
Copy link
Contributor Author

ifsnow commented Jan 29, 2017

@dougwilson It seems to be a good opinion.
You can now set rowsAsArray option for each query request.

connection.query({
  sql: 'SELECT ....',
  rowsAsArray: true
}, function (err, rows) {
  ... 
});

@dougwilson
Copy link
Member

Hi @ifsnow sorry for the delay in feedback, I'm struggling a bit to download your pull request using git am. Is it possible you can rebase your PR to be on top of the master branch of this repository?

@ifsnow
Copy link
Contributor Author

ifsnow commented Jan 31, 2017

@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.

@ifsnow
Copy link
Contributor Author

ifsnow commented Feb 1, 2017

@dougwilson I fixed my repository and created a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants