I'm using node.js pg-promise module to access a postgres database. It's all working great, except that the results always come back as an array of rows, each of which is a json object with keys and values. It seems wasteful of bandwidth - more than half of the data goes to the keys on each field.
What I'm getting is an array of hashes:
[{
"ID":110744,
"Name":"Mann,Julie",
"Firstname":"Julie",
"Surname":"Mann",
"ShortName":null,
"Date":0,
"Email":"julie_simmo_68@xyz.com",
"Mobile":"0410038xxx",
"Phone":"42615xxx"
}
,{
}
,{}....]
What I want is an array of arrays:
[
[110744,"Mann,Julie","Julie","Mann",null,0,"julie_simm@xyz.com","0410038xxx","4261 5xxx"]
,
[...]
,
[...]
]
Is there any way to extract the data as an array of arrays? An array of rows, with each row being an ordered list of field values, in the same order as they appear in the SELECT statement. It will help with the speed of queries, and with unpacking the resulting data if they are just bare data in strict column order. I've been searching all day and can't find anything.