Skip to content

rows as array of values without column with value object #981

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
iamtennislover opened this issue Jan 28, 2015 · 4 comments
Closed

rows as array of values without column with value object #981

iamtennislover opened this issue Jan 28, 2015 · 4 comments

Comments

@iamtennislover
Copy link

Is there a flag that can be set to allow the output for the following to be as

connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
  if (err) throw err;

  console.log('The solution is: ', rows[0].solution);
});

// output as: rows = [[2]] instead of row = [{solution: 2}]

Thanks,
Amit

@dougwilson
Copy link
Member

No, but #770 is the open feature request to implement this. If you can, please feel free to contribute an implementation :)!

@sidorares
Copy link
Member

@abarik1981 if you decide to implement it - would be good if its compatible with node-mysql2 ( https://github.com/sidorares/node-mysql2#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key )

@dougwilson
Copy link
Member

Ooo, I didn't know mysql2 has this :) I guess that means another answer is to try out mysql2 module :)

@sidorares
Copy link
Member

I doubt that array feature is that important to make a switch but if you really focus on speed than yes, worth trying :)

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

No branches or pull requests

3 participants