@mastra/pg 1.28.0-alpha.2 → 1.28.0-alpha.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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +4 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -16
- package/dist/index.js.map +1 -1
- package/dist/vector/sql-builder.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -458,14 +458,8 @@ function buildDeleteFilterQuery(filter) {
|
|
|
458
458
|
const joined = value.map((f) => {
|
|
459
459
|
const entries = Object.entries(f || {});
|
|
460
460
|
if (entries.length === 0) return "";
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
"$and",
|
|
464
|
-
"$or",
|
|
465
|
-
"$not",
|
|
466
|
-
"$nor"
|
|
467
|
-
].includes(firstKey)) return buildCondition(firstKey, firstValue, parentPath);
|
|
468
|
-
return entries.map(([k, v]) => buildCondition(k, v, parentPath)).join(` ${joinOperator} `);
|
|
461
|
+
const branchConditions = entries.map(([k, v]) => buildCondition(k, v, parentPath));
|
|
462
|
+
return branchConditions.length === 1 ? branchConditions[0] : `(${branchConditions.join(" AND ")})`;
|
|
469
463
|
}).join(` ${joinOperator} `);
|
|
470
464
|
const operatorFn = FILTER_OPERATORS[key];
|
|
471
465
|
return operatorFn(joined, 0, value).sql;
|
|
@@ -549,14 +543,8 @@ function buildFilterQuery(filter, minScore, topK) {
|
|
|
549
543
|
const joined = value.map((f) => {
|
|
550
544
|
const entries = Object.entries(f || {});
|
|
551
545
|
if (entries.length === 0) return "";
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
"$and",
|
|
555
|
-
"$or",
|
|
556
|
-
"$not",
|
|
557
|
-
"$nor"
|
|
558
|
-
].includes(firstKey)) return buildCondition(firstKey, firstValue, parentPath);
|
|
559
|
-
return entries.map(([k, v]) => buildCondition(k, v, parentPath)).join(` ${joinOperator} `);
|
|
546
|
+
const branchConditions = entries.map(([k, v]) => buildCondition(k, v, parentPath));
|
|
547
|
+
return branchConditions.length === 1 ? branchConditions[0] : `(${branchConditions.join(" AND ")})`;
|
|
560
548
|
}).join(` ${joinOperator} `);
|
|
561
549
|
const operatorFn = FILTER_OPERATORS[key];
|
|
562
550
|
return operatorFn(joined, 0, value).sql;
|