@aiao/rxdb-adapter-sqliteai 0.0.25 → 0.0.28

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.
@@ -3,8 +3,9 @@ import { SqliteaiOptions } from './sqliteai.interface.js';
3
3
  /**
4
4
  * 创建 SqliteAI 客户端实例并完成初始化。
5
5
  *
6
- * 如果 `options` 中指定了 worker / sharedWorker,会通过 `wrapWithComlink` 把客户端代理到 worker;
7
- * 否则在主线程直接 new。
6
+ * 如果 `options` 中指定了 worker / sharedWorker,会通过 `wrapWithComlinkEndpoint` 为这次连接租用
7
+ * worker 的一条独立子端口;否则在主线程直接 new。释放后同一个 worker 可以再连:恢复先用一条连接写库,
8
+ * 之后的 `connect()` 再开一条。
8
9
  *
9
10
  * 返回类型是 {@link SqliteClientLike} 而非具体的 `SqliteaiClient`:worker 模式下拿到的是
10
11
  * Comlink 远端代理,它把每个方法都 Promise 化,断言成实现类会让 `beginTransactionSql(): string`
@@ -1 +1 @@
1
- {"version":3,"file":"create_sqlite_client.d.ts","sourceRoot":"","sources":["../src/create_sqlite_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvH,OAAO,EAAE,eAAe,EAA4B,MAAM,yBAAyB,CAAC;AAGpF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkB5G"}
1
+ {"version":3,"file":"create_sqlite_client.d.ts","sourceRoot":"","sources":["../src/create_sqlite_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAA4B,MAAM,yBAAyB,CAAC;AAGpF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyB5G"}
package/dist/index.js CHANGED
@@ -1,59 +1,3 @@
1
- import { BATCH_TIMEOUT as e, Oo1ClientBase as t, ROWID as n, RxDBAdapterSqliteBase as r, RxDBAdapterSqliteError as i, SqliteRepository as a, assertLoadOptionsTransferable as o, assertOo1Static as s, buildOo1InitOptions as c, buildRuleGroup as l, defaultWarn as u, get_table_name as d, get_table_name_by_metadata as f, isSameOo1LoadConfig as p, toOo1LoadFingerprint as m, withGlobalOo1LoadLock as h, withPatchedOpfsProxyWorker as g, withSqliteApiConfig as _, wrapWithComlink as v } from "@aiao/rxdb-adapter-sqlite-core";
2
- import y from "@sqliteai/sqlite-wasm";
3
- //#region src/sqliteai-load.utils.ts
4
- var b, x;
5
- async function S(e) {
6
- let t = m(e), n = () => b && x && p(x, t) ? b : void 0;
7
- return n() || h(async () => {
8
- let r = n();
9
- if (r) return r;
10
- let i = c(e), a = await g(e, async () => await _({ warn: u }, async () => {
11
- let e = await y(i);
12
- return s(e), e;
13
- }));
14
- return a.config && (a.config.warn = u), b = a, x = t, a;
15
- });
16
- }
17
- //#endregion
18
- //#region src/SqliteaiClient.ts
19
- var C = class extends t {
20
- get clientName() {
21
- return "sqliteai";
22
- }
23
- loadModule(e) {
24
- return S(e);
25
- }
26
- };
27
- //#endregion
28
- //#region src/create_sqlite_client.ts
29
- async function w(e, t) {
30
- let n = {
31
- opfs: t.opfs,
32
- wasmPath: t.wasmPath,
33
- opfsProxyPath: t.opfsProxyPath,
34
- locateFile: t.locateFile,
35
- print: t.print,
36
- printErr: t.printErr,
37
- cacheSizeKb: t.cacheSizeKb,
38
- batchTimeout: t.batchTimeout,
39
- opfsFallback: t.opfsFallback
40
- };
41
- o(n, t);
42
- let r = v(new C(), t);
43
- return await r.init(e, n), r;
44
- }
45
- //#endregion
46
- //#region src/sqliteai.interface.ts
47
- var T = "sqliteai", E = class extends r {
48
- options;
49
- #e;
50
- name = T;
51
- constructor(e, t) {
52
- super(e, t), this.options = t, this.#e = e.config.dbName;
53
- }
54
- async createClient() {
55
- return w(this.#e, this.options);
56
- }
57
- };
58
- //#endregion
59
- export { e as BATCH_TIMEOUT, n as ROWID, i as RxDBAdapterSqliteError, E as RxDBAdapterSqliteai, a as SqliteRepository, C as SqliteaiClient, l as buildRuleGroup, w as createSqliteClient, d as sqliteGetTableName, f as sqliteGetTableNameByMetadata, S as sqliteaiLoad };
1
+ import { i as e, n as t, r as n, t as r } from "./RxDBAdapterSqliteai-DSoEdAS9.js";
2
+ import { BATCH_TIMEOUT as i, ROWID as a, RxDBAdapterSqliteError as o, SqliteRepository as s, buildRuleGroup as c, get_table_name as l, get_table_name_by_metadata as u } from "@aiao/rxdb-adapter-sqlite-core";
3
+ export { i as BATCH_TIMEOUT, a as ROWID, o as RxDBAdapterSqliteError, r as RxDBAdapterSqliteai, s as SqliteRepository, n as SqliteaiClient, c as buildRuleGroup, t as createSqliteClient, l as sqliteGetTableName, u as sqliteGetTableNameByMetadata, e as sqliteaiLoad };
@@ -0,0 +1,3 @@
1
+ import { AdapterFactory } from '@aiao/rxdb-adapter-sqlite-core/testing';
2
+ export declare const sqliteaiFactory: AdapterFactory;
3
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAM7E,eAAO,MAAM,eAAe,EAAE,cAAkF,CAAC"}