Is it possible to get an Array of Arrays from a query instead of an Array of Objects?
I mean, instead of this:
var result = alasql('SELECT field1, field2 FROM table_name');
// result = [{field1: "value1", field2: "value2"}, {field1: "value3", field2: "value4"}]
This:
var result = alasql('SELECT field1, field2 FROM table_name');
// result = [["value1", "value2"], ["value3", "value4"]]
I know I can do it myself afterwards, but maybe there is a way of telling alasql to do it internally so that the results are not iterated over again by me. If result has 300k rows * 10 fields this makes a difference.
By prepending MATRIX OF before SELECT you will get what you are looking for.
var result = alasql('MATRIX OF SELECT field1, field2 FROM table_name');
// result = [["value1", "value2"], ["value3", "value4"]]
Most helpful comment
By prepending
MATRIX OFbeforeSELECTyou will get what you are looking for.https://github.com/agershun/alasql/wiki/Matrix