@quereus/plugin-react-native-leveldb 0.3.1 → 0.4.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/README.md CHANGED
@@ -1,194 +1,208 @@
1
- # @quereus/plugin-react-native-leveldb
2
-
3
- LevelDB storage plugin for Quereus on React Native. Provides fast, persistent storage for mobile iOS and Android applications using the [`@quereus/store`](../quereus-store/) module.
4
-
5
- ## Features
6
-
7
- - **Fast**: LevelDB offers excellent read/write performance, significantly faster than AsyncStorage
8
- - **Synchronous API**: Uses rn-leveldb's synchronous, blocking APIs
9
- - **Binary data**: Full support for binary keys and values via ArrayBuffers
10
- - **Sorted keys**: Efficient range queries with ordered iteration
11
- - **Persistent**: Data survives app restarts
12
- - **Atomic batch writes**: Uses native LevelDB WriteBatch for atomic multi-key operations
13
-
14
- ## Installation
15
-
16
- ```bash
17
- npm install @quereus/plugin-react-native-leveldb @quereus/store rn-leveldb
18
-
19
- # Don't forget to link native modules
20
- cd ios && pod install
21
- ```
22
-
23
- ## Quick Start
24
-
25
- ### With registerPlugin (Recommended)
26
-
27
- ```typescript
28
- import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
29
- import { Database, registerPlugin } from '@quereus/quereus';
30
- import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
31
-
32
- const db = new Database();
33
- await registerPlugin(db, leveldbPlugin, {
34
- openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
35
- WriteBatch: LevelDBWriteBatch,
36
- });
37
-
38
- await db.exec(`
39
- create table users (id integer primary key, name text)
40
- using store
41
- `);
42
-
43
- await db.exec(`insert into users (id, name) values (1, 'Alice')`);
44
-
45
- const users = await db.all('select * from users');
46
- console.log(users);
47
- ```
48
-
49
- ### Direct Usage with Provider
50
-
51
- ```typescript
52
- import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
53
- import { Database } from '@quereus/quereus';
54
- import { createReactNativeLevelDBProvider } from '@quereus/plugin-react-native-leveldb';
55
- import { StoreModule } from '@quereus/store';
56
-
57
- const db = new Database();
58
- const provider = createReactNativeLevelDBProvider({
59
- openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
60
- WriteBatch: LevelDBWriteBatch,
61
- });
62
- const storeModule = new StoreModule(provider);
63
- db.registerModule('store', storeModule);
64
-
65
- await db.exec(`
66
- create table users (id integer primary key, name text)
67
- using store
68
- `);
69
- ```
70
-
71
- ## API
72
-
73
- ### ReactNativeLevelDBStore
74
-
75
- Low-level KVStore implementation:
76
-
77
- ```typescript
78
- import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
79
- import { ReactNativeLevelDBStore } from '@quereus/plugin-react-native-leveldb';
80
-
81
- // Open using the factory function
82
- const openFn = (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists);
83
- const store = ReactNativeLevelDBStore.open(openFn, LevelDBWriteBatch, 'mystore');
84
-
85
- await store.put(key, value);
86
- const data = await store.get(key);
87
- await store.delete(key);
88
-
89
- // Range iteration
90
- for await (const { key, value } of store.iterate({ gte: startKey, lt: endKey })) {
91
- console.log(key, value);
92
- }
93
-
94
- // Atomic batch writes (uses native LevelDB WriteBatch)
95
- const batch = store.batch();
96
- batch.put(key1, value1);
97
- batch.put(key2, value2);
98
- batch.delete(key3);
99
- await batch.write();
100
-
101
- await store.close();
102
- ```
103
-
104
- ### ReactNativeLevelDBProvider
105
-
106
- Factory for managing multiple stores:
107
-
108
- ```typescript
109
- import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
110
- import { createReactNativeLevelDBProvider } from '@quereus/plugin-react-native-leveldb';
111
-
112
- const provider = createReactNativeLevelDBProvider({
113
- openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
114
- WriteBatch: LevelDBWriteBatch,
115
- databaseName: 'myapp',
116
- });
117
-
118
- const userStore = await provider.getStore('main', 'users');
119
- const catalogStore = await provider.getCatalogStore();
120
-
121
- await provider.closeStore('main', 'users');
122
- await provider.closeAll();
123
- ```
124
-
125
- ## Configuration
126
-
127
- ### Plugin Settings
128
-
129
- | Setting | Type | Default | Description |
130
- |---------|------|---------|-------------|
131
- | `openFn` | function | **required** | Factory function: `(name, createIfMissing, errorIfExists) => LevelDB` |
132
- | `WriteBatch` | constructor | **required** | LevelDBWriteBatch constructor from rn-leveldb |
133
- | `databaseName` | string | `'quereus'` | Base name prefix for all LevelDB databases |
134
- | `createIfMissing` | boolean | `true` | Create databases if they don't exist |
135
- | `moduleName` | string | `'store'` | Name to register the virtual table module under |
136
-
137
- ## Example with Transactions
138
-
139
- ```typescript
140
- import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
141
- import { Database, registerPlugin } from '@quereus/quereus';
142
- import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
143
-
144
- const db = new Database();
145
- await registerPlugin(db, leveldbPlugin, {
146
- openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
147
- WriteBatch: LevelDBWriteBatch,
148
- });
149
-
150
- await db.exec(`create table accounts (id integer primary key, balance real) using store`);
151
-
152
- await db.exec('begin');
153
- try {
154
- await db.exec(`update accounts set balance = balance - 100 where id = 1`);
155
- await db.exec(`update accounts set balance = balance + 100 where id = 2`);
156
- await db.exec('commit');
157
- } catch (e) {
158
- await db.exec('rollback');
159
- throw e;
160
- }
161
- ```
162
-
163
- ## Why LevelDB?
164
-
165
- rn-leveldb provides significant performance advantages over other React Native storage options:
166
-
167
- | Storage Solution | Operations/sec | Notes |
168
- |------------------|----------------|-------|
169
- | rn-leveldb | ~50,000 | Synchronous, blocking API |
170
- | AsyncStorage | ~2,000 | JSON serialization overhead |
171
- | react-native-sqlite-storage | ~5,000 | Full SQL parsing overhead |
172
-
173
- LevelDB is ideal for Quereus because:
174
- - **Sorted keys**: Natural fit for the StoreModule's index-organized storage
175
- - **Binary support**: No JSON serialization needed for keys/values
176
- - **Range scans**: Efficient ordered iteration for query execution
177
-
178
- ## Peer Dependencies
179
-
180
- This plugin requires:
181
- - `@quereus/quereus` ^0.24.0
182
- - `@quereus/store` ^0.3.5
183
- - `rn-leveldb` ^3.11.0
184
-
185
- ## Related Packages
186
-
187
- - [`@quereus/store`](../quereus-store/) - Core storage module (StoreModule, StoreTable)
188
- - [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) - LevelDB plugin for Node.js
189
- - [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) - IndexedDB plugin for browsers
190
-
191
- ## License
192
-
193
- MIT
194
-
1
+ # @quereus/plugin-react-native-leveldb
2
+
3
+ LevelDB storage plugin for Quereus on React Native. Provides fast, persistent storage for mobile iOS and Android applications using the [`@quereus/store`](../quereus-store/) module.
4
+
5
+ ## Features
6
+
7
+ - **Fast**: LevelDB offers excellent read/write performance, significantly faster than AsyncStorage
8
+ - **Transaction isolation**: Read-your-own-writes and snapshot isolation by default
9
+ - **Synchronous API**: Uses rn-leveldb's synchronous, blocking APIs
10
+ - **Binary data**: Full support for binary keys and values via ArrayBuffers
11
+ - **Sorted keys**: Efficient range queries with ordered iteration
12
+ - **Persistent**: Data survives app restarts
13
+ - **Atomic batch writes**: Uses native LevelDB WriteBatch for atomic multi-key operations
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @quereus/plugin-react-native-leveldb @quereus/store @quereus/isolation rn-leveldb
19
+
20
+ # Don't forget to link native modules
21
+ cd ios && pod install
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ### With registerPlugin (Recommended)
27
+
28
+ ```typescript
29
+ import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
30
+ import { Database, registerPlugin } from '@quereus/quereus';
31
+ import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
32
+
33
+ const db = new Database();
34
+ await registerPlugin(db, leveldbPlugin, {
35
+ openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
36
+ WriteBatch: LevelDBWriteBatch,
37
+ });
38
+
39
+ await db.exec(`
40
+ create table users (id integer primary key, name text)
41
+ using store
42
+ `);
43
+
44
+ // Full transaction isolation enabled by default
45
+ await db.exec('BEGIN');
46
+ await db.exec(`insert into users (id, name) values (1, 'Alice')`);
47
+ const user = await db.get('select * from users where id = 1'); // Sees uncommitted insert
48
+ await db.exec('COMMIT');
49
+ ```
50
+
51
+ ### Disabling Isolation
52
+
53
+ If you need maximum performance and don't require read-your-own-writes within transactions:
54
+
55
+ ```typescript
56
+ await registerPlugin(db, leveldbPlugin, {
57
+ openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
58
+ WriteBatch: LevelDBWriteBatch,
59
+ isolation: false // Disable isolation layer
60
+ });
61
+ ```
62
+
63
+ ### Direct Usage with Provider
64
+
65
+ ```typescript
66
+ import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
67
+ import { Database } from '@quereus/quereus';
68
+ import { createReactNativeLevelDBProvider } from '@quereus/plugin-react-native-leveldb';
69
+ import { createIsolatedStoreModule } from '@quereus/store';
70
+
71
+ const db = new Database();
72
+ const provider = createReactNativeLevelDBProvider({
73
+ openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
74
+ WriteBatch: LevelDBWriteBatch,
75
+ });
76
+ const storeModule = new StoreModule(provider);
77
+ db.registerModule('store', storeModule);
78
+
79
+ await db.exec(`
80
+ create table users (id integer primary key, name text)
81
+ using store
82
+ `);
83
+ ```
84
+
85
+ ## API
86
+
87
+ ### ReactNativeLevelDBStore
88
+
89
+ Low-level KVStore implementation:
90
+
91
+ ```typescript
92
+ import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
93
+ import { ReactNativeLevelDBStore } from '@quereus/plugin-react-native-leveldb';
94
+
95
+ // Open using the factory function
96
+ const openFn = (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists);
97
+ const store = ReactNativeLevelDBStore.open(openFn, LevelDBWriteBatch, 'mystore');
98
+
99
+ await store.put(key, value);
100
+ const data = await store.get(key);
101
+ await store.delete(key);
102
+
103
+ // Range iteration
104
+ for await (const { key, value } of store.iterate({ gte: startKey, lt: endKey })) {
105
+ console.log(key, value);
106
+ }
107
+
108
+ // Atomic batch writes (uses native LevelDB WriteBatch)
109
+ const batch = store.batch();
110
+ batch.put(key1, value1);
111
+ batch.put(key2, value2);
112
+ batch.delete(key3);
113
+ await batch.write();
114
+
115
+ await store.close();
116
+ ```
117
+
118
+ ### ReactNativeLevelDBProvider
119
+
120
+ Factory for managing multiple stores:
121
+
122
+ ```typescript
123
+ import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
124
+ import { createReactNativeLevelDBProvider } from '@quereus/plugin-react-native-leveldb';
125
+
126
+ const provider = createReactNativeLevelDBProvider({
127
+ openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
128
+ WriteBatch: LevelDBWriteBatch,
129
+ databaseName: 'myapp',
130
+ });
131
+
132
+ const userStore = await provider.getStore('main', 'users');
133
+ const catalogStore = await provider.getCatalogStore();
134
+
135
+ await provider.closeStore('main', 'users');
136
+ await provider.closeAll();
137
+ ```
138
+
139
+ ## Configuration
140
+
141
+ ### Plugin Settings
142
+
143
+ | Setting | Type | Default | Description |
144
+ |---------|------|---------|-------------|
145
+ | `openFn` | function | **required** | Factory function: `(name, createIfMissing, errorIfExists) => LevelDB` |
146
+ | `WriteBatch` | constructor | **required** | LevelDBWriteBatch constructor from rn-leveldb |
147
+ | `databaseName` | string | `'quereus'` | Base name prefix for all LevelDB databases |
148
+ | `createIfMissing` | boolean | `true` | Create databases if they don't exist |
149
+ | `moduleName` | string | `'store'` | Name to register the virtual table module under |
150
+
151
+ ## Example with Transactions
152
+
153
+ ```typescript
154
+ import { LevelDB, LevelDBWriteBatch } from 'rn-leveldb';
155
+ import { Database, registerPlugin } from '@quereus/quereus';
156
+ import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
157
+
158
+ const db = new Database();
159
+ await registerPlugin(db, leveldbPlugin, {
160
+ openFn: (name, createIfMissing, errorIfExists) => new LevelDB(name, createIfMissing, errorIfExists),
161
+ WriteBatch: LevelDBWriteBatch,
162
+ });
163
+
164
+ await db.exec(`create table accounts (id integer primary key, balance real) using store`);
165
+
166
+ await db.exec('begin');
167
+ try {
168
+ await db.exec(`update accounts set balance = balance - 100 where id = 1`);
169
+ await db.exec(`update accounts set balance = balance + 100 where id = 2`);
170
+ await db.exec('commit');
171
+ } catch (e) {
172
+ await db.exec('rollback');
173
+ throw e;
174
+ }
175
+ ```
176
+
177
+ ## Why LevelDB?
178
+
179
+ rn-leveldb provides significant performance advantages over other React Native storage options:
180
+
181
+ | Storage Solution | Operations/sec | Notes |
182
+ |------------------|----------------|-------|
183
+ | rn-leveldb | ~50,000 | Synchronous, blocking API |
184
+ | AsyncStorage | ~2,000 | JSON serialization overhead |
185
+ | react-native-sqlite-storage | ~5,000 | Full SQL parsing overhead |
186
+
187
+ LevelDB is ideal for Quereus because:
188
+ - **Sorted keys**: Natural fit for the StoreModule's index-organized storage
189
+ - **Binary support**: No JSON serialization needed for keys/values
190
+ - **Range scans**: Efficient ordered iteration for query execution
191
+
192
+ ## Peer Dependencies
193
+
194
+ This plugin requires:
195
+ - `@quereus/quereus` ^0.24.0
196
+ - `@quereus/store` ^0.3.5
197
+ - `rn-leveldb` ^3.11.0
198
+
199
+ ## Related Packages
200
+
201
+ - [`@quereus/store`](../quereus-store/) - Core storage module (StoreModule, StoreTable)
202
+ - [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) - LevelDB plugin for Node.js
203
+ - [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) - IndexedDB plugin for browsers
204
+
205
+ ## License
206
+
207
+ MIT
208
+
@@ -37,6 +37,12 @@ export interface ReactNativeLevelDBPluginConfig {
37
37
  * @default 'store'
38
38
  */
39
39
  moduleName?: string;
40
+ /**
41
+ * Enable transaction isolation (read-your-own-writes, snapshot isolation).
42
+ * When true, wraps the store module with an isolation layer.
43
+ * @default true
44
+ */
45
+ isolation?: boolean;
40
46
  }
41
47
  /**
42
48
  * Register the React Native LevelDB plugin with a database.
@@ -62,7 +68,7 @@ export interface ReactNativeLevelDBPluginConfig {
62
68
  export default function register(_db: Database, config?: Record<string, SqlValue>): {
63
69
  vtables: {
64
70
  name: string;
65
- module: StoreModule;
71
+ module: import("@quereus/isolation").IsolationModule | StoreModule;
66
72
  }[];
67
73
  };
68
74
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,UAAU,EAAE,4BAA4B,CAAC;IAEzC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAG,EAAE,QAAQ,EACb,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAM;;;;;EAyCrC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAA6B,MAAM,gBAAgB,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,UAAU,EAAE,4BAA4B,CAAC;IAEzC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAG,EAAE,QAAQ,EACb,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAM;;;;;EA4CrC"}
@@ -4,7 +4,7 @@
4
4
  * Registers a StoreModule backed by LevelDB for React Native mobile environments.
5
5
  * Uses rn-leveldb for native LevelDB bindings.
6
6
  */
7
- import { StoreModule } from '@quereus/store';
7
+ import { StoreModule, createIsolatedStoreModule } from '@quereus/store';
8
8
  import { ReactNativeLevelDBProvider } from './provider.js';
9
9
  /**
10
10
  * Register the React Native LevelDB plugin with a database.
@@ -43,13 +43,16 @@ export default function register(_db, config = {}) {
43
43
  const databaseName = config.databaseName ?? 'quereus';
44
44
  const createIfMissing = config.createIfMissing !== false;
45
45
  const moduleName = config.moduleName ?? 'store';
46
+ const isolation = config.isolation ?? true;
46
47
  const provider = new ReactNativeLevelDBProvider({
47
48
  openFn,
48
49
  WriteBatch,
49
50
  databaseName,
50
51
  createIfMissing,
51
52
  });
52
- const storeModule = new StoreModule(provider);
53
+ const storeModule = isolation
54
+ ? createIsolatedStoreModule({ provider })
55
+ : new StoreModule(provider);
53
56
  return {
54
57
  vtables: [
55
58
  {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAuC3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAa,EACb,SAAmC,EAAE;IAErC,6CAA6C;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAkC,CAAC;IACzD,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACd,oEAAoE;YACpE,wIAAwI,CACxI,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAqD,CAAC;IAChF,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACd,uEAAuE;YACvE,uEAAuE,CACvE,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAI,MAAM,CAAC,YAAuB,IAAI,SAAS,CAAC;IAClE,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,KAAK,KAAK,CAAC;IACzD,MAAM,UAAU,GAAI,MAAM,CAAC,UAAqB,IAAI,OAAO,CAAC;IAE5D,MAAM,QAAQ,GAAG,IAAI,0BAA0B,CAAC;QAC/C,MAAM;QACN,UAAU;QACV,YAAY;QACZ,eAAe;KACf,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO;QACN,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,WAAW;aACnB;SACD;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AA8C3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAa,EACb,SAAmC,EAAE;IAErC,6CAA6C;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAkC,CAAC;IACzD,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACd,oEAAoE;YACpE,wIAAwI,CACxI,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAqD,CAAC;IAChF,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACd,uEAAuE;YACvE,uEAAuE,CACvE,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAI,MAAM,CAAC,YAAuB,IAAI,SAAS,CAAC;IAClE,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,KAAK,KAAK,CAAC;IACzD,MAAM,UAAU,GAAI,MAAM,CAAC,UAAqB,IAAI,OAAO,CAAC;IAC5D,MAAM,SAAS,GAAI,MAAM,CAAC,SAAqB,IAAI,IAAI,CAAC;IAExD,MAAM,QAAQ,GAAG,IAAI,0BAA0B,CAAC;QAC/C,MAAM;QACN,UAAU;QACV,YAAY;QACZ,eAAe;KACf,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,SAAS;QAC5B,CAAC,CAAC,yBAAyB,CAAC,EAAE,QAAQ,EAAE,CAAC;QACzC,CAAC,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE7B,OAAO;QACN,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,WAAW;aACnB;SACD;KACD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quereus/plugin-react-native-leveldb",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "React Native LevelDB storage plugin for Quereus - mobile persistent storage",
6
6
  "keywords": [
@@ -41,8 +41,9 @@
41
41
  }
42
42
  },
43
43
  "peerDependencies": {
44
- "@quereus/quereus": "^0.12.1",
45
- "@quereus/store": "^0.5.1",
44
+ "@quereus/isolation": "^0.2.0",
45
+ "@quereus/quereus": "^0.13.0",
46
+ "@quereus/store": "^0.6.0",
46
47
  "rn-leveldb": "^3.11.0"
47
48
  },
48
49
  "engines": {
@@ -68,6 +69,13 @@
68
69
  "type": "string",
69
70
  "default": "store",
70
71
  "help": "Name to register the virtual table module under"
72
+ },
73
+ {
74
+ "key": "isolation",
75
+ "label": "Transaction Isolation",
76
+ "type": "boolean",
77
+ "default": true,
78
+ "help": "Enable transaction isolation (read-your-own-writes, snapshot isolation)"
71
79
  }
72
80
  ]
73
81
  },
@@ -78,6 +86,7 @@
78
86
  "test": "cd ../.. && node --import ./packages/quereus-plugin-react-native-leveldb/register.mjs node_modules/mocha/bin/mocha.js \"packages/quereus-plugin-react-native-leveldb/test/**/*.spec.ts\" --colors"
79
87
  },
80
88
  "devDependencies": {
89
+ "@quereus/isolation": "*",
81
90
  "@quereus/quereus": "*",
82
91
  "@quereus/store": "*",
83
92
  "@types/chai": "^5.2.2",