@quereus/plugin-nativescript-sqlite 0.3.0 → 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 +21 -6
- package/dist/src/plugin.d.ts +7 -1
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +5 -2
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/provider.d.ts +3 -2
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +15 -9
- package/dist/src/provider.js.map +1 -1
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ SQLite storage plugin for Quereus on NativeScript. Provides persistent storage f
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Native SQLite**: Uses the device's built-in SQLite via `@nativescript-community/sqlite`
|
|
8
|
+
- **Transaction isolation**: Read-your-own-writes and snapshot isolation by default
|
|
8
9
|
- **Order-preserving keys**: BLOB keys with `memcmp()` comparison ensure correct lexicographic byte ordering
|
|
9
10
|
- **Single database file**: All stores share one SQLite database (separate tables)
|
|
10
11
|
- **ACID transactions**: SQLite transactions for atomic batch writes
|
|
@@ -13,7 +14,7 @@ SQLite storage plugin for Quereus on NativeScript. Provides persistent storage f
|
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
npm install @quereus/plugin-nativescript-sqlite @quereus/store @nativescript-community/sqlite
|
|
17
|
+
npm install @quereus/plugin-nativescript-sqlite @quereus/store @quereus/isolation @nativescript-community/sqlite
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
Or with NativeScript CLI:
|
|
@@ -41,13 +42,26 @@ await registerPlugin(db, sqlitePlugin, { db: sqliteDb });
|
|
|
41
42
|
|
|
42
43
|
// Create tables using the 'store' module
|
|
43
44
|
await db.exec(`
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
create table users (id integer primary key, name text)
|
|
46
|
+
using store
|
|
46
47
|
`);
|
|
47
48
|
|
|
48
|
-
//
|
|
49
|
+
// Full transaction isolation enabled by default
|
|
50
|
+
await db.exec('BEGIN');
|
|
49
51
|
await db.exec(`insert into users values (1, 'Alice')`);
|
|
50
|
-
const
|
|
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
|
+
});
|
|
51
65
|
```
|
|
52
66
|
|
|
53
67
|
### Direct Usage with Provider
|
|
@@ -56,7 +70,8 @@ const users = await db.all(`select * from users`);
|
|
|
56
70
|
import { openOrCreate } from '@nativescript-community/sqlite';
|
|
57
71
|
import { Database } from '@quereus/quereus';
|
|
58
72
|
import { createSQLiteProvider } from '@quereus/plugin-nativescript-sqlite';
|
|
59
|
-
import {
|
|
73
|
+
import { createIsolatedStoreModule } from '@quereus/store';
|
|
74
|
+
|
|
60
75
|
|
|
61
76
|
const sqliteDb = openOrCreate('quereus.db');
|
|
62
77
|
const provider = createSQLiteProvider({ db: sqliteDb });
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export interface SQLitePluginConfig {
|
|
|
25
25
|
* @default 'store'
|
|
26
26
|
*/
|
|
27
27
|
moduleName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Enable transaction isolation (read-your-own-writes, snapshot isolation).
|
|
30
|
+
* When true, wraps the store module with an isolation layer.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
isolation?: boolean;
|
|
28
34
|
}
|
|
29
35
|
/**
|
|
30
36
|
* Register the NativeScript SQLite plugin with a database.
|
|
@@ -48,7 +54,7 @@ export interface SQLitePluginConfig {
|
|
|
48
54
|
export default function register(_db: Database, config?: Record<string, SqlValue>): {
|
|
49
55
|
vtables: {
|
|
50
56
|
name: string;
|
|
51
|
-
module: StoreModule;
|
|
57
|
+
module: import("@quereus/isolation").IsolationModule | StoreModule;
|
|
52
58
|
}[];
|
|
53
59
|
};
|
|
54
60
|
//# sourceMappingURL=plugin.d.ts.map
|
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,
|
|
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;;;;OAIG;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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Registers a StoreModule backed by SQLite for NativeScript mobile environments.
|
|
5
5
|
*/
|
|
6
|
-
import { StoreModule } from '@quereus/store';
|
|
6
|
+
import { StoreModule, createIsolatedStoreModule } from '@quereus/store';
|
|
7
7
|
import { SQLiteProvider } from './provider.js';
|
|
8
8
|
/**
|
|
9
9
|
* Register the NativeScript SQLite plugin with a database.
|
|
@@ -33,11 +33,14 @@ export default function register(_db, config = {}) {
|
|
|
33
33
|
}
|
|
34
34
|
const tablePrefix = config.tablePrefix ?? 'quereus_';
|
|
35
35
|
const moduleName = config.moduleName ?? 'store';
|
|
36
|
+
const isolation = config.isolation ?? true;
|
|
36
37
|
const provider = new SQLiteProvider({
|
|
37
38
|
db: sqliteDb,
|
|
38
39
|
tablePrefix,
|
|
39
40
|
});
|
|
40
|
-
const storeModule =
|
|
41
|
+
const storeModule = isolation
|
|
42
|
+
? createIsolatedStoreModule({ provider })
|
|
43
|
+
: new StoreModule(provider);
|
|
41
44
|
return {
|
|
42
45
|
vtables: [
|
|
43
46
|
{
|
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,MAAM,gBAAgB,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;AAiC/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/provider.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Storage naming convention:
|
|
8
8
|
* {prefix}{schema}_{table} - Data store (row data)
|
|
9
9
|
* {prefix}{schema}_{table}_idx_{name} - Index store (secondary indexes)
|
|
10
|
-
* {prefix}
|
|
10
|
+
* {prefix}__stats__ - Unified stats store (row counts for all tables)
|
|
11
11
|
* {prefix}__catalog__ - Catalog store (DDL metadata)
|
|
12
12
|
*/
|
|
13
13
|
import type { KVStore, KVStoreProvider } from '@quereus/store';
|
|
@@ -38,6 +38,7 @@ export declare class SQLiteProvider implements KVStoreProvider {
|
|
|
38
38
|
private tablePrefix;
|
|
39
39
|
private stores;
|
|
40
40
|
private catalogStore;
|
|
41
|
+
private statsStore;
|
|
41
42
|
constructor(options: SQLiteProviderOptions);
|
|
42
43
|
/**
|
|
43
44
|
* Get the table name for a store.
|
|
@@ -50,7 +51,7 @@ export declare class SQLiteProvider implements KVStoreProvider {
|
|
|
50
51
|
private getStoreKey;
|
|
51
52
|
getStore(schemaName: string, tableName: string, _options?: Record<string, unknown>): Promise<KVStore>;
|
|
52
53
|
getIndexStore(schemaName: string, tableName: string, indexName: string): Promise<KVStore>;
|
|
53
|
-
getStatsStore(
|
|
54
|
+
getStatsStore(_schemaName: string, _tableName: string): Promise<KVStore>;
|
|
54
55
|
getCatalogStore(): Promise<KVStore>;
|
|
55
56
|
closeStore(schemaName: string, tableName: string): Promise<void>;
|
|
56
57
|
closeIndexStore(schemaName: string, tableName: string, indexName: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,eAAe;IACrD,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,YAAY,CAA4B;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,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,eAAe;CAO7B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAEnF"}
|
package/dist/src/provider.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Storage naming convention:
|
|
8
8
|
* {prefix}{schema}_{table} - Data store (row data)
|
|
9
9
|
* {prefix}{schema}_{table}_idx_{name} - Index store (secondary indexes)
|
|
10
|
-
* {prefix}
|
|
10
|
+
* {prefix}__stats__ - Unified stats store (row counts for all tables)
|
|
11
11
|
* {prefix}__catalog__ - Catalog store (DDL metadata)
|
|
12
12
|
*/
|
|
13
|
-
import { STORE_SUFFIX } from '@quereus/store';
|
|
13
|
+
import { STORE_SUFFIX, STATS_STORE_NAME } from '@quereus/store';
|
|
14
14
|
import { SQLiteStore } from './store.js';
|
|
15
15
|
/**
|
|
16
16
|
* SQLite implementation of KVStoreProvider for NativeScript.
|
|
@@ -23,6 +23,7 @@ export class SQLiteProvider {
|
|
|
23
23
|
tablePrefix;
|
|
24
24
|
stores = new Map();
|
|
25
25
|
catalogStore = null;
|
|
26
|
+
statsStore = null;
|
|
26
27
|
constructor(options) {
|
|
27
28
|
this.db = options.db;
|
|
28
29
|
this.tablePrefix = options.tablePrefix ?? 'quereus_';
|
|
@@ -50,10 +51,12 @@ export class SQLiteProvider {
|
|
|
50
51
|
const sqliteTableName = `${this.getTableName(schemaName, tableName)}${STORE_SUFFIX.INDEX}${indexName}`.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
51
52
|
return this.getOrCreateStore(key, sqliteTableName);
|
|
52
53
|
}
|
|
53
|
-
async getStatsStore(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
async getStatsStore(_schemaName, _tableName) {
|
|
55
|
+
// Use the unified __stats__ store for all tables
|
|
56
|
+
if (!this.statsStore) {
|
|
57
|
+
this.statsStore = SQLiteStore.create(this.db, `${this.tablePrefix}${STATS_STORE_NAME}`);
|
|
58
|
+
}
|
|
59
|
+
return this.statsStore;
|
|
57
60
|
}
|
|
58
61
|
async getCatalogStore() {
|
|
59
62
|
if (!this.catalogStore) {
|
|
@@ -78,6 +81,10 @@ export class SQLiteProvider {
|
|
|
78
81
|
await this.catalogStore.close();
|
|
79
82
|
this.catalogStore = null;
|
|
80
83
|
}
|
|
84
|
+
if (this.statsStore) {
|
|
85
|
+
await this.statsStore.close();
|
|
86
|
+
this.statsStore = null;
|
|
87
|
+
}
|
|
81
88
|
// Close the underlying database
|
|
82
89
|
this.db.close();
|
|
83
90
|
}
|
|
@@ -90,9 +97,8 @@ export class SQLiteProvider {
|
|
|
90
97
|
// Close data store
|
|
91
98
|
const dataKey = this.getStoreKey(schemaName, tableName);
|
|
92
99
|
await this.closeStoreByKey(dataKey);
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
await this.closeStoreByKey(statsKey);
|
|
100
|
+
// Stats are in the unified __stats__ store, so no need to close a separate store
|
|
101
|
+
// The individual stats entry will be removed by the calling code if needed
|
|
96
102
|
// Close all index stores for this table
|
|
97
103
|
const indexPrefix = `${dataKey}${STORE_SUFFIX.INDEX}`;
|
|
98
104
|
for (const [key, store] of this.stores) {
|
package/dist/src/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAmB9D;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IAClB,EAAE,CAAiB;IACnB,WAAW,CAAS;IACpB,MAAM,GAAG,I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AM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;IAEO,gBAAgB,CAAC,GAAW,EAAE,eAAuB;QAC5D,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,GAAW;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,KAAK,EAAE,CAAC;YACX,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IAClE,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quereus/plugin-nativescript-sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "NativeScript SQLite storage plugin for Quereus - mobile persistent storage",
|
|
6
6
|
"keywords": [
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@nativescript-community/sqlite": "^3.0.0",
|
|
45
|
-
"@quereus/
|
|
46
|
-
"@quereus/
|
|
45
|
+
"@quereus/isolation": "^0.2.0",
|
|
46
|
+
"@quereus/quereus": "^0.13.0",
|
|
47
|
+
"@quereus/store": "^0.6.0"
|
|
47
48
|
},
|
|
48
49
|
"engines": {
|
|
49
50
|
"quereus": "^0.24.0"
|
|
@@ -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-nativescript-sqlite/register.mjs node_modules/mocha/bin/mocha.js \"packages/quereus-plugin-nativescript-sqlite/test/**/*.spec.ts\" --colors"
|
|
79
87
|
},
|
|
80
88
|
"devDependencies": {
|
|
89
|
+
"@quereus/isolation": "*",
|
|
81
90
|
"@quereus/quereus": "*",
|
|
82
91
|
"@quereus/store": "*",
|
|
83
92
|
"@types/better-sqlite3": "^7.6.13",
|