Skip to content

Commit 738a65e

Browse files
committed
Stripping column information from RNQS raw result.
1 parent 3ab99a0 commit 738a65e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-native/src/db/adapters/react-native-quick-sqlite/RNQSDBAdapter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export class RNQSDBAdapter extends BaseObserver<DBAdapterListener> implements DB
7171
*/
7272
async executeRaw(query: string, params?: any[]): Promise<any[][]> {
7373
const result = await this.baseDB.execute(query, params);
74-
return result.rows?._array ?? [];
74+
const rows = result.rows?._array ?? [];
75+
return rows.map((row) => Object.values(row));
7576
}
7677

7778
async executeBatch(query: string, params: any[][] = []): Promise<QueryResult> {
@@ -93,7 +94,8 @@ export class RNQSDBAdapter extends BaseObserver<DBAdapterListener> implements DB
9394
// 'executeRaw' is not implemented in RNQS, this falls back to 'execute'.
9495
executeRaw: async (sql: string, params?: any[]) => {
9596
const result = await ctx.execute(sql, params);
96-
return result.rows?._array ?? [];
97+
const rows = result.rows?._array ?? [];
98+
return rows.map((row) => Object.values(row));
9799
}
98100
};
99101
}

0 commit comments

Comments
 (0)