tndrle / node-sqlite3-wasm

WebAssembly port of SQLite3 for Node.js with file system access
MIT License
55 stars 8 forks source link

Return an array of arrays and column metadata rather than an array of objects #67

Open mikeburgh opened 1 month ago

mikeburgh commented 1 month ago

Great work! Solves so many headaches with electron!

Have you any plans to add support for returning an array of arrays (rather than objects) and column metadata ?

better-sqlite3 does this via a raw method to enable it, and then a columns method to fetch the column metadata.

https://github.com/WiseLibs/better-sqlite3/blob/master/docs/api.md#rawtogglestate---this

My use case for the array of arrays is dealing with overlapping column names, a contrived example is:

select 'short' as 'long', 'test' as 'long';

The meta data is to be able to handle better typing in the returned results.

Some other node based database drivers will return it in one call rather than needing two like better does... but I have not dug into see if it is something specific to SQLite that requires the two methods or just their API approach.