@aiao/rxdb-adapter-pglite 0.0.14 → 0.0.16

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.
@@ -7,26 +7,10 @@ import { RxDBAdapterPGlite } from './RxDBAdapterPGlite.js';
7
7
  *
8
8
  * ## 优化策略
9
9
  *
10
- * ### 1. 按 Patch 键分组(T034)
11
- * 对于更新操作,按实体的 `patch` 字段键进行哈希分组。相同字段修改的实体会被分到同一组,
12
- * 可以用一条 SQL 语句批量更新,减少数据库往返次数。
13
- *
14
- * **示例:**
15
- * ```typescript
16
- * // 3 个用户,2 个只修改 name,1 个只修改 email
17
- * user1.name = 'Updated 1'; // patch: { name }
18
- * user2.name = 'Updated 2'; // patch: { name } - 与 user1 同组
19
- * user3.email = 'new@example.com'; // patch: { email } - 独立一组
20
- *
21
- * // 结果:生成 2 条 UPDATE 语句而不是 3 条
22
- * // UPDATE users SET name = ... WHERE id IN ('user1-id', 'user2-id')
23
- * // UPDATE users SET email = ... WHERE id = 'user3-id'
24
- * ```
25
- *
26
- * ### 2. 参数化查询
10
+ * ### 1. 参数化查询
27
11
  * 使用 PostgreSQL 的参数化查询(`$1`, `$2`等),避免 SQL 注入风险,提升安全性。
28
12
  *
29
- * ### 3. 批量查询结果
13
+ * ### 2. 批量查询结果
30
14
  * INSERT/UPDATE 后,使用 `WHERE id IN (...)` 批量查询更新后的数据,减少数据库往返。
31
15
  *
32
16
  * ## 事务保证
@@ -1 +1 @@
1
- {"version":3,"file":"rxdb_adapter_mutations.d.ts","sourceRoot":"","sources":["../src/rxdb_adapter_mutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAsC,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQ9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;yBACmB,CAAC,SAAS,UAAU,GAAG,GAAG,EAC9C,SAAS,iBAAiB,EAC1B,WAAW,gBAAgB,CAAC,CAAC,CAAC,KAE7B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;AAJ7B,wBAmHE"}
1
+ {"version":3,"file":"rxdb_adapter_mutations.d.ts","sourceRoot":"","sources":["../src/rxdb_adapter_mutations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAsC,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAO9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;yBACmB,CAAC,SAAS,UAAU,GAAG,GAAG,EAC9C,SAAS,iBAAiB,EAC1B,WAAW,gBAAgB,CAAC,CAAC,CAAC,KAE7B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;AAJ7B,wBAuGE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiao/rxdb-adapter-pglite",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -29,13 +29,12 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@electric-sql/pglite": "^0.3.14",
32
- "object-hash": "^3.0.0",
33
32
  "rxjs": "^7.8.2",
34
33
  "type-fest": "^5.4.4",
35
- "@aiao/rxdb": "0.0.14",
36
- "@aiao/utils": "0.0.14"
34
+ "@aiao/rxdb": "0.0.16",
35
+ "@aiao/utils": "0.0.16"
37
36
  },
38
37
  "devDependencies": {
39
- "@aiao/rxdb-test": "0.0.14"
38
+ "@aiao/rxdb-test": "0.0.16"
40
39
  }
41
40
  }