@powersync/op-sqlite 0.3.0 → 0.3.1
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/OPSqliteAdapter.js +6 -1
- package/lib/commonjs/db/OPSqliteAdapter.js.map +1 -1
- package/lib/module/db/OPSqliteAdapter.js +6 -1
- package/lib/module/db/OPSqliteAdapter.js.map +1 -1
- 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/OPSqliteAdapter.d.ts.map +1 -1
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/db/OPSqliteAdapter.ts +9 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/op-sqlite",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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.23.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.23.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@op-engineering/op-sqlite": "^11.2.13",
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DBAdapter,
|
|
4
|
-
DBAdapterListener,
|
|
5
|
-
DBLockOptions,
|
|
6
|
-
QueryResult,
|
|
7
|
-
Transaction
|
|
8
|
-
} from '@powersync/common';
|
|
9
|
-
import {
|
|
10
|
-
ANDROID_DATABASE_PATH,
|
|
11
|
-
getDylibPath,
|
|
12
|
-
IOS_LIBRARY_PATH,
|
|
13
|
-
open,
|
|
14
|
-
type DB
|
|
15
|
-
} from '@op-engineering/op-sqlite';
|
|
1
|
+
import { BaseObserver, DBAdapter, DBAdapterListener, DBLockOptions, QueryResult, Transaction } from '@powersync/common';
|
|
2
|
+
import { ANDROID_DATABASE_PATH, getDylibPath, IOS_LIBRARY_PATH, open, type DB } from '@op-engineering/op-sqlite';
|
|
16
3
|
import Lock from 'async-lock';
|
|
17
4
|
import { OPSQLiteConnection } from './OPSQLiteConnection';
|
|
18
5
|
import { Platform } from 'react-native';
|
|
@@ -283,7 +270,12 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
|
|
|
283
270
|
await commit();
|
|
284
271
|
return result;
|
|
285
272
|
} catch (ex) {
|
|
286
|
-
|
|
273
|
+
try {
|
|
274
|
+
await rollback();
|
|
275
|
+
} catch (ex2) {
|
|
276
|
+
// In rare cases, a rollback may fail.
|
|
277
|
+
// Safe to ignore.
|
|
278
|
+
}
|
|
287
279
|
throw ex;
|
|
288
280
|
}
|
|
289
281
|
}
|
|
@@ -292,7 +284,7 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
|
|
|
292
284
|
await this.initialized;
|
|
293
285
|
await this.writeConnection!.refreshSchema();
|
|
294
286
|
|
|
295
|
-
if(this.readConnections) {
|
|
287
|
+
if (this.readConnections) {
|
|
296
288
|
for (let readConnection of this.readConnections) {
|
|
297
289
|
await readConnection.connection.refreshSchema();
|
|
298
290
|
}
|