capacitor-community / capacitor-community/sqlite

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

Open
#633 0 comments 0 reactions 0 assignees View on GitHub
feature needs: triage
Dominant language
Swift
Stars
661
Forks
158
PR merge metrics
No merged PRs in 30d

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.