Skip to content

Commit 970c308

Browse files
PuddySqlQuery --> set warn added.
1 parent d37d6cd commit 970c308

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PuddySqlQuery.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,8 @@ class PuddySqlQuery {
14661466
*/
14671467
escapeValuesFix(v, name) {
14681468
const column = this.#table?.[name];
1469-
if(!isJsonObject(column)) throw new Error(`Column "${name}" does not exist in the table definition.`);
1469+
if (!isJsonObject(column))
1470+
throw new Error(`Column "${name}" does not exist in the table definition.`);
14701471
const type = column.type ?? '';
14711472
const func = this.#jsonEscapeFix[type];
14721473
if (typeof func !== 'function') return v;
@@ -1547,6 +1548,9 @@ class PuddySqlQuery {
15471548
/**
15481549
* Insert or update one or more records with given data.
15491550
*
1551+
* ⚠️ **Important:** The table must have both `id` and `subId` configured as a composite **PRIMARY KEY**
1552+
* (or as a **UNIQUE constraint**) for the upsert operation to work correctly with conflict resolution.
1553+
*
15501554
* If `valueObj` is an array, `id` must also be an array of the same length.
15511555
* All objects inside the array must have identical keys.
15521556
*

0 commit comments

Comments
 (0)