Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add possibility to return rows as Object Array or as two dimensional Array #633

Open
lasher23 opened this issue Apr 1, 2025 · 0 comments

Comments

@lasher23
Copy link

lasher23 commented Apr 1, 2025

Is your feature request related to a problem? Please describe:
I use other SQL Libraries which expect the results as two dimensional array.
As far as i can see, the object logic is also self implemented (only checked android) https://github.com/capacitor-community/sqlite/blob/master/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java#L984

This is also inspired by the SQLite WASM lib, where you can configure the 'rowMode' property as object or array

Describe the solution you'd like:
I would like to be able to configure if a SQL Query returns the result as Object or as two dimensional array.

For Example:
Old: [{col1: "value1"}]
New: [["value1"]]

It would be nice if it would be possible to configure this per query or on the Connection. Maybe make it hierarchical.
For compatibility reasons the default should stay with objects.

Describe alternatives you've considered:
Transform object to array. But this might be tricky because the order of columns must match the sql statements order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant