@powersync/op-sqlite 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/db/OPSQLiteConnection.js +3 -0
- package/lib/commonjs/db/OPSQLiteConnection.js.map +1 -1
- package/lib/commonjs/db/OPSqliteAdapter.js +4 -0
- package/lib/commonjs/db/OPSqliteAdapter.js.map +1 -1
- package/lib/module/db/OPSQLiteConnection.js +3 -0
- package/lib/module/db/OPSQLiteConnection.js.map +1 -1
- package/lib/module/db/OPSqliteAdapter.js +4 -0
- package/lib/module/db/OPSqliteAdapter.js.map +1 -1
- package/lib/typescript/commonjs/src/db/OPSQLiteConnection.d.ts +1 -0
- package/lib/typescript/commonjs/src/db/OPSQLiteConnection.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts +1 -0
- package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts.map +1 -1
- package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -1
- package/lib/typescript/module/src/db/OPSQLiteConnection.d.ts +1 -0
- package/lib/typescript/module/src/db/OPSQLiteConnection.d.ts.map +1 -1
- package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts +1 -0
- package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts.map +1 -1
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/db/OPSQLiteConnection.ts +4 -0
- package/src/db/OPSqliteAdapter.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/op-sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "PowerSync - sync Postgres or MongoDB with SQLite in your React Native app for offline-first and real-time data",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@op-engineering/op-sqlite": "^11.2.13",
|
|
62
|
-
"@powersync/common": "^1.
|
|
62
|
+
"@powersync/common": "^1.26.0",
|
|
63
63
|
"react": "*",
|
|
64
64
|
"react-native": "*"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"async-lock": "^1.4.0",
|
|
68
|
-
"@powersync/common": "1.
|
|
68
|
+
"@powersync/common": "1.26.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@op-engineering/op-sqlite": "^11.2.13",
|
|
@@ -97,6 +97,10 @@ export class OPSQLiteConnection extends BaseObserver<DBAdapterListener> {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
async executeRaw(query: string, params?: any[]): Promise<any[][]> {
|
|
101
|
+
return await this.DB.executeRaw(query, params);
|
|
102
|
+
}
|
|
103
|
+
|
|
100
104
|
async executeBatch(query: string, params: any[][] = []): Promise<QueryResult> {
|
|
101
105
|
const tuple: SQLBatchTuple[] = [[query, params[0]]];
|
|
102
106
|
params.slice(1).forEach((p) => tuple.push([query, p]));
|
|
@@ -245,6 +245,10 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
|
|
|
245
245
|
return this.writeLock((ctx) => ctx.execute(query, params));
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
executeRaw(query: string, params?: any[]) {
|
|
249
|
+
return this.writeLock((ctx) => ctx.executeRaw(query, params));
|
|
250
|
+
}
|
|
251
|
+
|
|
248
252
|
async executeBatch(query: string, params: any[][] = []): Promise<QueryResult> {
|
|
249
253
|
return this.writeLock((ctx) => ctx.executeBatch(query, params));
|
|
250
254
|
}
|
|
@@ -272,6 +276,7 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
|
|
|
272
276
|
await connection.execute('BEGIN');
|
|
273
277
|
const result = await fn({
|
|
274
278
|
execute: (query, params) => connection.execute(query, params),
|
|
279
|
+
executeRaw: (query, params) => connection.executeRaw(query, params),
|
|
275
280
|
get: (query, params) => connection.get(query, params),
|
|
276
281
|
getAll: (query, params) => connection.getAll(query, params),
|
|
277
282
|
getOptional: (query, params) => connection.getOptional(query, params),
|