@equationalapplications/core-llm-wiki 9.4.2 → 9.4.3

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/dist/index.js CHANGED
@@ -245,10 +245,13 @@ var SQLITE_RESULT_CODE_NAMES = {
245
245
  27: "SQLITE_NOTICE",
246
246
  28: "SQLITE_WARNING",
247
247
  // Extended result codes (https://sqlite.org/rescode.html#extended_result_code_list).
248
- // 2067 = SQLITE_CONSTRAINT_UNIQUE — raised when a UNIQUE index/PRIMARY KEY
249
- // rejects an INSERT/UPDATE; expo-sqlite reports this as a numeric "Error code N:"
250
- // prefix and we normalize it back to the symbolic name so callers can branch on
251
- // the same string the rest of the ecosystem uses.
248
+ // 2067 = SQLITE_CONSTRAINT_UNIQUE — a UNIQUE index rejecting an INSERT/UPDATE.
249
+ // better-sqlite3 / node:sqlite enable extended result codes and report it
250
+ // directly. expo-sqlite never emits it (as of expo-sqlite 58.0.14, per
251
+ // #403): it leaves extended result codes off
252
+ // and surfaces the same failure as the primary code 19 with the
253
+ // "UNIQUE constraint failed" message text, which `extractSqliteCode` below
254
+ // refines back to this name (#403).
252
255
  2067: "SQLITE_CONSTRAINT_UNIQUE",
253
256
  // 267 = SQLITE_CORRUPT_VTAB — a corrupt FTS5 shadow table (ftsCorruptionClass).
254
257
  267: "SQLITE_CORRUPT_VTAB",
@@ -264,7 +267,13 @@ function extractSqliteCode(err) {
264
267
  if (typeof code === "string" && code.startsWith("SQLITE_")) return code;
265
268
  if (typeof message === "string") {
266
269
  const m = /^Error code (\d+):/.exec(message);
267
- if (m) return nameForSqliteResultCode(Number(m[1]));
270
+ if (m) {
271
+ const n = Number(m[1]);
272
+ if (n === 19 && message.includes("UNIQUE constraint failed")) {
273
+ return nameForSqliteResultCode(2067);
274
+ }
275
+ return nameForSqliteResultCode(n);
276
+ }
268
277
  }
269
278
  return void 0;
270
279
  }