Skip to content

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

Open
@lasher23

Description

@lasher23

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions