@quereus/plugin-nativescript-sqlite 4.3.1 → 4.3.2
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 +195 -195
- package/dist/src/plugin.d.ts +2 -1
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/store.js +5 -5
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
# @quereus/plugin-nativescript-sqlite
|
|
2
|
-
|
|
3
|
-
SQLite storage plugin for Quereus on NativeScript. Provides persistent storage for iOS and Android mobile apps using the [`@quereus/store`](../quereus-store/) module.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Native SQLite**: Uses the device's built-in SQLite via `@nativescript-community/sqlite`
|
|
8
|
-
- **Transaction isolation**: Read-your-own-writes
|
|
9
|
-
- **Order-preserving keys**: BLOB keys with `memcmp()` comparison ensure correct lexicographic byte ordering
|
|
10
|
-
- **Single database file**: All stores share one SQLite database (separate tables)
|
|
11
|
-
- **ACID transactions**: SQLite transactions for atomic batch writes
|
|
12
|
-
- **WITHOUT ROWID**: Optimized key-value table structure
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install @quereus/plugin-nativescript-sqlite @quereus/store @quereus/isolation @nativescript-community/sqlite
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Or with NativeScript CLI:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
ns plugin add @quereus/plugin-nativescript-sqlite
|
|
24
|
-
ns plugin add @nativescript-community/sqlite
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Quick Start
|
|
28
|
-
|
|
29
|
-
### With registerPlugin (Recommended)
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
33
|
-
import { Database, registerPlugin } from '@quereus/quereus';
|
|
34
|
-
import sqlitePlugin from '@quereus/plugin-nativescript-sqlite/plugin';
|
|
35
|
-
|
|
36
|
-
// Open or create the SQLite database
|
|
37
|
-
const sqliteDb = openOrCreate('quereus.db');
|
|
38
|
-
|
|
39
|
-
// Create Quereus database and register the plugin
|
|
40
|
-
const db = new Database();
|
|
41
|
-
await registerPlugin(db, sqlitePlugin, { db: sqliteDb });
|
|
42
|
-
|
|
43
|
-
// Create tables using the 'store' module
|
|
44
|
-
await db.exec(`
|
|
45
|
-
create table users (id integer primary key, name text)
|
|
46
|
-
using store
|
|
47
|
-
`);
|
|
48
|
-
|
|
49
|
-
// Full transaction isolation enabled by default
|
|
50
|
-
await db.exec('BEGIN');
|
|
51
|
-
await db.exec(`insert into users values (1, 'Alice')`);
|
|
52
|
-
const user = await db.get(`select * from users where id = 1`); // Sees uncommitted insert
|
|
53
|
-
await db.exec('COMMIT');
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Disabling Isolation
|
|
57
|
-
|
|
58
|
-
If you need maximum performance and don't require read-your-own-writes within transactions:
|
|
59
|
-
|
|
60
|
-
```typescript
|
|
61
|
-
await registerPlugin(db, sqlitePlugin, {
|
|
62
|
-
db: sqliteDb,
|
|
63
|
-
isolation: false // Disable isolation layer
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Direct Usage with Provider
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
71
|
-
import { Database } from '@quereus/quereus';
|
|
72
|
-
import { createSQLiteProvider } from '@quereus/plugin-nativescript-sqlite';
|
|
73
|
-
import { createIsolatedStoreModule } from '@quereus/store';
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const sqliteDb = openOrCreate('quereus.db');
|
|
77
|
-
const provider = createSQLiteProvider({ db: sqliteDb });
|
|
78
|
-
const storeModule = new StoreModule(provider);
|
|
79
|
-
|
|
80
|
-
const db = new Database();
|
|
81
|
-
db.registerModule('store', storeModule);
|
|
82
|
-
|
|
83
|
-
await db.exec(`
|
|
84
|
-
create table users (id integer primary key, name text)
|
|
85
|
-
using store
|
|
86
|
-
`);
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## API
|
|
90
|
-
|
|
91
|
-
### SQLiteStore
|
|
92
|
-
|
|
93
|
-
Low-level KVStore implementation backed by a SQLite table:
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
97
|
-
import { SQLiteStore } from '@quereus/plugin-nativescript-sqlite';
|
|
98
|
-
|
|
99
|
-
const sqliteDb = openOrCreate('myapp.db');
|
|
100
|
-
const store = SQLiteStore.create(sqliteDb, 'my_kv_table');
|
|
101
|
-
|
|
102
|
-
// Key-value operations (keys and values are Uint8Array)
|
|
103
|
-
await store.put(key, value);
|
|
104
|
-
const data = await store.get(key);
|
|
105
|
-
await store.delete(key);
|
|
106
|
-
|
|
107
|
-
// Range iteration
|
|
108
|
-
for await (const { key, value } of store.iterate({ gte: startKey, lt: endKey })) {
|
|
109
|
-
console.log(key, value);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Batch writes (atomic)
|
|
113
|
-
const batch = store.batch();
|
|
114
|
-
batch.put(key1, value1);
|
|
115
|
-
batch.put(key2, value2);
|
|
116
|
-
batch.delete(key3);
|
|
117
|
-
await batch.write();
|
|
118
|
-
|
|
119
|
-
await store.close();
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### SQLiteProvider
|
|
123
|
-
|
|
124
|
-
Factory for managing multiple stores in a single SQLite database:
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
128
|
-
import { createSQLiteProvider } from '@quereus/plugin-nativescript-sqlite';
|
|
129
|
-
|
|
130
|
-
const sqliteDb = openOrCreate('quereus.db');
|
|
131
|
-
const provider = createSQLiteProvider({ db: sqliteDb });
|
|
132
|
-
|
|
133
|
-
// Each store gets its own table: quereus_main_users, quereus_main_orders, etc.
|
|
134
|
-
const userStore = await provider.getStore('main', 'users');
|
|
135
|
-
const orderStore = await provider.getStore('main', 'orders');
|
|
136
|
-
const catalogStore = await provider.getCatalogStore();
|
|
137
|
-
|
|
138
|
-
await provider.closeStore('main', 'users');
|
|
139
|
-
await provider.closeAll(); // Also closes the SQLite database
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Configuration
|
|
143
|
-
|
|
144
|
-
### Plugin Settings
|
|
145
|
-
|
|
146
|
-
| Setting | Type | Default | Description |
|
|
147
|
-
|---------|------|---------|-------------|
|
|
148
|
-
| `db` | SQLiteDatabase | **required** | SQLite database from `openOrCreate()` |
|
|
149
|
-
| `tablePrefix` | string | `'quereus_'` | Prefix for all table names |
|
|
150
|
-
| `moduleName` | string | `'store'` | Virtual table module name for `USING` clause |
|
|
151
|
-
|
|
152
|
-
### SQLiteStore Options
|
|
153
|
-
|
|
154
|
-
| Option | Type | Default | Description |
|
|
155
|
-
|--------|------|---------|-------------|
|
|
156
|
-
| `db` | SQLiteDatabase | **required** | The SQLite database instance |
|
|
157
|
-
| `tableName` | string | `'kv'` | Table name for this store |
|
|
158
|
-
|
|
159
|
-
## How It Works
|
|
160
|
-
|
|
161
|
-
### Key Storage
|
|
162
|
-
|
|
163
|
-
Keys and values are stored as BLOBs (binary). SQLite compares BLOBs using `memcmp()`, which provides correct lexicographic byte ordering - exactly what's needed for range scans.
|
|
164
|
-
|
|
165
|
-
### Table Structure
|
|
166
|
-
|
|
167
|
-
Each store creates a table with this schema:
|
|
168
|
-
|
|
169
|
-
```sql
|
|
170
|
-
create table quereus_main_users (
|
|
171
|
-
key blob primary key,
|
|
172
|
-
value blob
|
|
173
|
-
) without rowid
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
The `WITHOUT ROWID` optimization is ideal for key-value workloads where the key is the primary lookup.
|
|
177
|
-
|
|
178
|
-
## Platform Support
|
|
179
|
-
|
|
180
|
-
| Platform | Status |
|
|
181
|
-
|----------|--------|
|
|
182
|
-
| iOS | ✅ Supported |
|
|
183
|
-
| Android | ✅ Supported |
|
|
184
|
-
| NativeScript 8+ | ✅ Supported |
|
|
185
|
-
|
|
186
|
-
## Related Packages
|
|
187
|
-
|
|
188
|
-
- [`@quereus/store`](../quereus-store/) - Core storage module (StoreModule, StoreTable)
|
|
189
|
-
- [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) - LevelDB plugin for Node.js
|
|
190
|
-
- [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) - IndexedDB plugin for browsers
|
|
191
|
-
|
|
192
|
-
## License
|
|
193
|
-
|
|
194
|
-
MIT
|
|
195
|
-
|
|
1
|
+
# @quereus/plugin-nativescript-sqlite
|
|
2
|
+
|
|
3
|
+
SQLite storage plugin for Quereus on NativeScript. Provides persistent storage for iOS and Android mobile apps using the [`@quereus/store`](../quereus-store/) module.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Native SQLite**: Uses the device's built-in SQLite via `@nativescript-community/sqlite`
|
|
8
|
+
- **Transaction isolation**: Read-committed + read-your-own-writes by default (no write-write conflict detection; not snapshot isolation)
|
|
9
|
+
- **Order-preserving keys**: BLOB keys with `memcmp()` comparison ensure correct lexicographic byte ordering
|
|
10
|
+
- **Single database file**: All stores share one SQLite database (separate tables)
|
|
11
|
+
- **ACID transactions**: SQLite transactions for atomic batch writes
|
|
12
|
+
- **WITHOUT ROWID**: Optimized key-value table structure
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @quereus/plugin-nativescript-sqlite @quereus/store @quereus/isolation @nativescript-community/sqlite
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or with NativeScript CLI:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ns plugin add @quereus/plugin-nativescript-sqlite
|
|
24
|
+
ns plugin add @nativescript-community/sqlite
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### With registerPlugin (Recommended)
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
33
|
+
import { Database, registerPlugin } from '@quereus/quereus';
|
|
34
|
+
import sqlitePlugin from '@quereus/plugin-nativescript-sqlite/plugin';
|
|
35
|
+
|
|
36
|
+
// Open or create the SQLite database
|
|
37
|
+
const sqliteDb = openOrCreate('quereus.db');
|
|
38
|
+
|
|
39
|
+
// Create Quereus database and register the plugin
|
|
40
|
+
const db = new Database();
|
|
41
|
+
await registerPlugin(db, sqlitePlugin, { db: sqliteDb });
|
|
42
|
+
|
|
43
|
+
// Create tables using the 'store' module
|
|
44
|
+
await db.exec(`
|
|
45
|
+
create table users (id integer primary key, name text)
|
|
46
|
+
using store
|
|
47
|
+
`);
|
|
48
|
+
|
|
49
|
+
// Full transaction isolation enabled by default
|
|
50
|
+
await db.exec('BEGIN');
|
|
51
|
+
await db.exec(`insert into users values (1, 'Alice')`);
|
|
52
|
+
const user = await db.get(`select * from users where id = 1`); // Sees uncommitted insert
|
|
53
|
+
await db.exec('COMMIT');
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Disabling Isolation
|
|
57
|
+
|
|
58
|
+
If you need maximum performance and don't require read-your-own-writes within transactions:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
await registerPlugin(db, sqlitePlugin, {
|
|
62
|
+
db: sqliteDb,
|
|
63
|
+
isolation: false // Disable isolation layer
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Direct Usage with Provider
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
71
|
+
import { Database } from '@quereus/quereus';
|
|
72
|
+
import { createSQLiteProvider } from '@quereus/plugin-nativescript-sqlite';
|
|
73
|
+
import { createIsolatedStoreModule } from '@quereus/store';
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
const sqliteDb = openOrCreate('quereus.db');
|
|
77
|
+
const provider = createSQLiteProvider({ db: sqliteDb });
|
|
78
|
+
const storeModule = new StoreModule(provider);
|
|
79
|
+
|
|
80
|
+
const db = new Database();
|
|
81
|
+
db.registerModule('store', storeModule);
|
|
82
|
+
|
|
83
|
+
await db.exec(`
|
|
84
|
+
create table users (id integer primary key, name text)
|
|
85
|
+
using store
|
|
86
|
+
`);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
### SQLiteStore
|
|
92
|
+
|
|
93
|
+
Low-level KVStore implementation backed by a SQLite table:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
97
|
+
import { SQLiteStore } from '@quereus/plugin-nativescript-sqlite';
|
|
98
|
+
|
|
99
|
+
const sqliteDb = openOrCreate('myapp.db');
|
|
100
|
+
const store = SQLiteStore.create(sqliteDb, 'my_kv_table');
|
|
101
|
+
|
|
102
|
+
// Key-value operations (keys and values are Uint8Array)
|
|
103
|
+
await store.put(key, value);
|
|
104
|
+
const data = await store.get(key);
|
|
105
|
+
await store.delete(key);
|
|
106
|
+
|
|
107
|
+
// Range iteration
|
|
108
|
+
for await (const { key, value } of store.iterate({ gte: startKey, lt: endKey })) {
|
|
109
|
+
console.log(key, value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Batch writes (atomic)
|
|
113
|
+
const batch = store.batch();
|
|
114
|
+
batch.put(key1, value1);
|
|
115
|
+
batch.put(key2, value2);
|
|
116
|
+
batch.delete(key3);
|
|
117
|
+
await batch.write();
|
|
118
|
+
|
|
119
|
+
await store.close();
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### SQLiteProvider
|
|
123
|
+
|
|
124
|
+
Factory for managing multiple stores in a single SQLite database:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
128
|
+
import { createSQLiteProvider } from '@quereus/plugin-nativescript-sqlite';
|
|
129
|
+
|
|
130
|
+
const sqliteDb = openOrCreate('quereus.db');
|
|
131
|
+
const provider = createSQLiteProvider({ db: sqliteDb });
|
|
132
|
+
|
|
133
|
+
// Each store gets its own table: quereus_main_users, quereus_main_orders, etc.
|
|
134
|
+
const userStore = await provider.getStore('main', 'users');
|
|
135
|
+
const orderStore = await provider.getStore('main', 'orders');
|
|
136
|
+
const catalogStore = await provider.getCatalogStore();
|
|
137
|
+
|
|
138
|
+
await provider.closeStore('main', 'users');
|
|
139
|
+
await provider.closeAll(); // Also closes the SQLite database
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Configuration
|
|
143
|
+
|
|
144
|
+
### Plugin Settings
|
|
145
|
+
|
|
146
|
+
| Setting | Type | Default | Description |
|
|
147
|
+
|---------|------|---------|-------------|
|
|
148
|
+
| `db` | SQLiteDatabase | **required** | SQLite database from `openOrCreate()` |
|
|
149
|
+
| `tablePrefix` | string | `'quereus_'` | Prefix for all table names |
|
|
150
|
+
| `moduleName` | string | `'store'` | Virtual table module name for `USING` clause |
|
|
151
|
+
|
|
152
|
+
### SQLiteStore Options
|
|
153
|
+
|
|
154
|
+
| Option | Type | Default | Description |
|
|
155
|
+
|--------|------|---------|-------------|
|
|
156
|
+
| `db` | SQLiteDatabase | **required** | The SQLite database instance |
|
|
157
|
+
| `tableName` | string | `'kv'` | Table name for this store |
|
|
158
|
+
|
|
159
|
+
## How It Works
|
|
160
|
+
|
|
161
|
+
### Key Storage
|
|
162
|
+
|
|
163
|
+
Keys and values are stored as BLOBs (binary). SQLite compares BLOBs using `memcmp()`, which provides correct lexicographic byte ordering - exactly what's needed for range scans.
|
|
164
|
+
|
|
165
|
+
### Table Structure
|
|
166
|
+
|
|
167
|
+
Each store creates a table with this schema:
|
|
168
|
+
|
|
169
|
+
```sql
|
|
170
|
+
create table quereus_main_users (
|
|
171
|
+
key blob primary key,
|
|
172
|
+
value blob
|
|
173
|
+
) without rowid
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The `WITHOUT ROWID` optimization is ideal for key-value workloads where the key is the primary lookup.
|
|
177
|
+
|
|
178
|
+
## Platform Support
|
|
179
|
+
|
|
180
|
+
| Platform | Status |
|
|
181
|
+
|----------|--------|
|
|
182
|
+
| iOS | ✅ Supported |
|
|
183
|
+
| Android | ✅ Supported |
|
|
184
|
+
| NativeScript 8+ | ✅ Supported |
|
|
185
|
+
|
|
186
|
+
## Related Packages
|
|
187
|
+
|
|
188
|
+
- [`@quereus/store`](../quereus-store/) - Core storage module (StoreModule, StoreTable)
|
|
189
|
+
- [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) - LevelDB plugin for Node.js
|
|
190
|
+
- [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) - IndexedDB plugin for browsers
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
MIT
|
|
195
|
+
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export interface SQLitePluginConfig {
|
|
|
26
26
|
*/
|
|
27
27
|
moduleName?: string;
|
|
28
28
|
/**
|
|
29
|
-
* Enable transaction isolation (read-your-own-writes,
|
|
29
|
+
* Enable transaction isolation (read-committed + read-your-own-writes, no
|
|
30
|
+
* write-write conflict detection — NOT snapshot isolation).
|
|
30
31
|
* When true, wraps the store module with an isolation layer.
|
|
31
32
|
* @default true
|
|
32
33
|
*/
|
package/dist/src/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAA6B,MAAM,gBAAgB,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAA6B,MAAM,gBAAgB,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAG,EAAE,QAAQ,EACb,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAM;;;;;EAgCrC"}
|
package/dist/src/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkC/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC/B,GAAa,EACb,SAAmC,EAAE;IAErC,uCAAuC;IACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAA+B,CAAC;IACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACd,2FAA2F;YAC3F,uEAAuE,CACvE,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GAAI,MAAM,CAAC,WAAsB,IAAI,UAAU,CAAC;IACjE,MAAM,UAAU,GAAI,MAAM,CAAC,UAAqB,IAAI,OAAO,CAAC;IAC5D,MAAM,SAAS,GAAI,MAAM,CAAC,SAAqB,IAAI,IAAI,CAAC;IAExD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC;QACnC,EAAE,EAAE,QAAQ;QACZ,WAAW;KACX,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/dist/src/store.js
CHANGED
|
@@ -39,11 +39,11 @@ export class SQLiteStore {
|
|
|
39
39
|
ensureTable() {
|
|
40
40
|
// Use WITHOUT ROWID for better key-value performance
|
|
41
41
|
// Keys are BLOBs - SQLite uses memcmp() for correct byte ordering
|
|
42
|
-
this.db.execute(`
|
|
43
|
-
create table if not exists ${this.tableName} (
|
|
44
|
-
key blob primary key,
|
|
45
|
-
value blob
|
|
46
|
-
) without rowid
|
|
42
|
+
this.db.execute(`
|
|
43
|
+
create table if not exists ${this.tableName} (
|
|
44
|
+
key blob primary key,
|
|
45
|
+
value blob
|
|
46
|
+
) without rowid
|
|
47
47
|
`);
|
|
48
48
|
}
|
|
49
49
|
async get(key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quereus/plugin-nativescript-sqlite",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "NativeScript SQLite storage plugin for Quereus - mobile persistent storage",
|
|
6
6
|
"keywords": [
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@nativescript-community/sqlite": "^3.0.0",
|
|
45
|
-
"@quereus/isolation": "^4.3.
|
|
46
|
-
"@quereus/quereus": "^4.3.
|
|
47
|
-
"@quereus/store": "^4.3.
|
|
45
|
+
"@quereus/isolation": "^4.3.2",
|
|
46
|
+
"@quereus/quereus": "^4.3.2",
|
|
47
|
+
"@quereus/store": "^4.3.2"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"quereus": "^0.24.0"
|
|
@@ -82,12 +82,13 @@
|
|
|
82
82
|
"scripts": {
|
|
83
83
|
"clean": "rimraf dist",
|
|
84
84
|
"build": "tsc",
|
|
85
|
+
"lint": "echo 'No lint configured'",
|
|
85
86
|
"typecheck": "tsc --noEmit",
|
|
86
87
|
"test": "cd ../.. && node --import ./packages/quereus-plugin-nativescript-sqlite/register.mjs node_modules/mocha/bin/mocha.js \"packages/quereus-plugin-nativescript-sqlite/test/**/*.spec.ts\" --reporter min --colors"
|
|
87
88
|
},
|
|
88
89
|
"dependencies": {
|
|
89
|
-
"@quereus/quereus": "^4.3.
|
|
90
|
-
"@quereus/store": "^4.3.
|
|
90
|
+
"@quereus/quereus": "^4.3.2",
|
|
91
|
+
"@quereus/store": "^4.3.2"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
94
|
"@quereus/isolation": "*",
|