jsql-neo 6.4.7 → 6.4.8

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
@@ -3,7 +3,7 @@
3
3
  > **One engine to rule them all** — a Rust-powered embedded database that speaks your language:
4
4
  > MySQL, PostgreSQL, MongoDB, Redis, SQL, TypeScript, **and the browser**.
5
5
 
6
- > **v6.4.7** — official release build · [github.com/vexify-org/JSQL-neo](https://github.com/vexify-org/JSQL-neo) · [jsql.vexify.top](https://jsql.vexify.top)
6
+ > **v6.4.8** — official release build · [github.com/vexify-org/JSQL-neo](https://github.com/vexify-org/JSQL-neo) · [jsql.vexify.top](https://jsql.vexify.top)
7
7
 
8
8
  ![Engines](https://img.shields.io/badge/engines-Native%20%7C%20WASM%20%7C%20Pure%20JS-7ee787)
9
9
  ![MySQL](https://img.shields.io/badge/protocol-MySQL%20compatible-1f6feb)
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * JSQL-NEO v6.4.7 — Rust-Powered Embedded Database (WASM + HTTP)
2
+ * JSQL-NEO v6.4.8 — Rust-Powered Embedded Database (WASM + HTTP)
3
3
  *
4
4
  * @example
5
5
  * const jsql = require('jsql-neo');
@@ -802,6 +802,14 @@ class JSQL {
802
802
  if (!schema) return;
803
803
  const fields = Object.keys(schema).filter(f => schema[f] && (schema[f].primaryKey || schema[f].unique));
804
804
  if (!fields.length) return;
805
+ // 只在**确实要改主键 / UNIQUE 列**时才做冲突检查。
806
+ // UPDATE t SET age = 30 WHERE id = 1 —— age 不是主键,不可能造成键冲突。
807
+ //
808
+ // 此前先把整表 jsqlFind 一遍(limit 1000000 = 20 万行全量 JSON 化),再进
809
+ // 循环逐字段 find/some。updateById 于是在 20 万行的表上要 250~500ms ——
810
+ // 比读整张表还贵,而它本来只需要定位一行。
811
+ const touched = fields.filter(f => Object.prototype.hasOwnProperty.call(data, f));
812
+ if (!touched.length) return;
805
813
  const raw = this._n('jsqlFind', table, '{}', 1000000, 0);
806
814
  const all = safeParse(raw);
807
815
  if (!Array.isArray(all)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsql-neo",
3
- "version": "6.4.7",
3
+ "version": "6.4.8",
4
4
  "description": "JSQL-NEO — Rust-powered embedded database with WASM, REST API, B-Tree indexes, WAL, crash recovery",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",