Skip to content
Advertisement

node js sql output

I am trying to come up with the node.js code to get the output of this query:

JavaScript

The problem is that when I use it without the connection.escape(), I get the output, but with single quotes like this:

enter image description here

How can I (1) get rid of the (index) column, and (2) get rid of the single quotes? Getting rid of the single quotes is really the priority.

Thanks!

Advertisement

Answer

Index column and quotes are added by console.table function itself.

You can check it running console.table with any static data like here: https://developer.mozilla.org/en-US/docs/Web/API/Console/table#collections_of_primitive_types

To print it in a way you want it, implement printing function on your own.

Advertisement