-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
What is the problem this feature will solve?
Currently node:sqlite Session.* methods retrieve rows only as objects. In the application we write columns are auto-generated, their names are inherently meaningless, and their retrieval as an object would result in node_sqlite wasting CPU cycles to construct the object, and then I would have to run through reverse lookup loop over the keys of that unnecessarily constructed object to reproduce the original array of values as specified in the SELECT <expression1>, <expression2>, ... <expressionN>
sequence.
In other words,
- I'll have to encode it as
SELECT <expression1> AS c0, <expression2> AS c1, ... <expressionN> AS cN
- node:sqlite would have to construct and return an object
{ c0: <val>, c1: <val>, ..., cN: <val>}
- And then I'll have to reconstruct the array by interating over the object keys
[c0, c1, ..., cN]
to arrive at[val0, val1, ..., valN]
.
I'd like to request support of array row retrieval, just like it's already supported by all other sqlite APIs (like better-sqlite3, native WASM sqlite api-oo1, etc).
Object retrieval is unnecessary wasteful and impractical, especially when the number of retrieved columns (expressions) is measured in hundreds and their names are inherently meaningless.
What is the feature you are proposing to solve the problem?
Either add a parameter to request an array per row instead of object per row, or add additional methods that achieve this.
Other libraries tend to pass this in as a parameter.
What alternatives have you considered?
better-sqlite3, sqlite WASM api-oo1, even python libraries support this.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status