@powersync/react-native 1.12.4 → 1.14.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.
@@ -1,5 +1,5 @@
1
1
  import { BaseObserver, DBAdapter, DBAdapterListener, LockContext as PowerSyncLockContext, Transaction as PowerSyncTransaction, DBLockOptions, QueryResult } from '@powersync/common';
2
- import { QuickSQLiteConnection } from '@journeyapps/react-native-quick-sqlite';
2
+ import type { QuickSQLiteConnection } from '@journeyapps/react-native-quick-sqlite';
3
3
  /**
4
4
  * Adapter for React Native Quick SQLite
5
5
  */
@@ -1,4 +1,4 @@
1
- import { DBAdapter, SQLOpenOptions, SQLOpenFactory } from '@powersync/common';
1
+ import { DBAdapter, SQLOpenFactory, SQLOpenOptions } from '@powersync/common';
2
2
  /**
3
3
  * Opens a SQLite connection using React Native Quick SQLite
4
4
  */
@@ -1,4 +1,3 @@
1
- import { open, QuickSQLite } from '@journeyapps/react-native-quick-sqlite';
2
1
  import { RNQSDBAdapter } from './RNQSDBAdapter';
3
2
  /**
4
3
  * Opens a SQLite connection using React Native Quick SQLite
@@ -17,17 +16,18 @@ export class ReactNativeQuickSqliteOpenFactory {
17
16
  * in the options (if provided)
18
17
  * https://github.com/margelo/react-native-quick-sqlite/blob/main/README.md#loading-existing-dbs
19
18
  */
19
+ const rnqs = require('@journeyapps/react-native-quick-sqlite');
20
20
  const { dbFilename } = this.options;
21
21
  const openOptions = { location: this.options.dbLocation };
22
22
  let DB;
23
23
  try {
24
24
  // Hot reloads can sometimes clear global JS state, but not close DB on native side
25
- DB = open(dbFilename, openOptions);
25
+ DB = rnqs.open(dbFilename, openOptions);
26
26
  }
27
27
  catch (ex) {
28
28
  if (ex.message.includes('already open')) {
29
- QuickSQLite.close(dbFilename);
30
- DB = open(dbFilename, openOptions);
29
+ rnqs.QuickSQLite.close(dbFilename);
30
+ DB = rnqs.open(dbFilename, openOptions);
31
31
  }
32
32
  else {
33
33
  throw ex;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@powersync/react-native",
3
- "version": "1.12.4",
3
+ "version": "1.14.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
7
7
  },
8
8
  "description": "PowerSync - sync Postgres with SQLite in your React Native app for offline-first and real-time data",
9
9
  "main": "./dist/index.js",
10
+ "module": "./dist/index.js",
10
11
  "types": "./lib/index.d.ts",
11
12
  "files": [
12
13
  "lib",
@@ -23,18 +24,23 @@
23
24
  },
24
25
  "homepage": "https://docs.powersync.com/",
25
26
  "peerDependencies": {
26
- "@journeyapps/react-native-quick-sqlite": "^1.3.0",
27
- "@powersync/common": "^1.19.0",
27
+ "@journeyapps/react-native-quick-sqlite": "^2.0.0",
28
+ "@powersync/common": "^1.20.0",
28
29
  "react": "*",
29
30
  "react-native": "*"
30
31
  },
32
+ "peerDependenciesMeta": {
33
+ "@journeyapps/react-native-quick-sqlite": {
34
+ "optional": true
35
+ }
36
+ },
31
37
  "dependencies": {
32
- "@powersync/common": "1.19.0",
38
+ "@powersync/common": "1.20.0",
33
39
  "@powersync/react": "1.4.5"
34
40
  },
35
41
  "devDependencies": {
36
42
  "@craftzdog/react-native-buffer": "^6.0.5",
37
- "@journeyapps/react-native-quick-sqlite": "^1.3.0",
43
+ "@journeyapps/react-native-quick-sqlite": "^2.0.0",
38
44
  "@rollup/plugin-alias": "^5.1.0",
39
45
  "@rollup/plugin-commonjs": "^25.0.7",
40
46
  "@rollup/plugin-inject": "^5.0.5",