@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/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -482,14 +482,8 @@ function buildDeleteFilterQuery(filter) {
|
|
|
482
482
|
const joined = value.map((f) => {
|
|
483
483
|
const entries = Object.entries(f || {});
|
|
484
484
|
if (entries.length === 0) return "";
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
"$and",
|
|
488
|
-
"$or",
|
|
489
|
-
"$not",
|
|
490
|
-
"$nor"
|
|
491
|
-
].includes(firstKey)) return buildCondition(firstKey, firstValue, parentPath);
|
|
492
|
-
return entries.map(([k, v]) => buildCondition(k, v, parentPath)).join(` ${joinOperator} `);
|
|
485
|
+
const branchConditions = entries.map(([k, v]) => buildCondition(k, v, parentPath));
|
|
486
|
+
return branchConditions.length === 1 ? branchConditions[0] : `(${branchConditions.join(" AND ")})`;
|
|
493
487
|
}).join(` ${joinOperator} `);
|
|
494
488
|
const operatorFn = FILTER_OPERATORS[key];
|
|
495
489
|
return operatorFn(joined, 0, value).sql;
|
|
@@ -573,14 +567,8 @@ function buildFilterQuery(filter, minScore, topK) {
|
|
|
573
567
|
const joined = value.map((f) => {
|
|
574
568
|
const entries = Object.entries(f || {});
|
|
575
569
|
if (entries.length === 0) return "";
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
"$and",
|
|
579
|
-
"$or",
|
|
580
|
-
"$not",
|
|
581
|
-
"$nor"
|
|
582
|
-
].includes(firstKey)) return buildCondition(firstKey, firstValue, parentPath);
|
|
583
|
-
return entries.map(([k, v]) => buildCondition(k, v, parentPath)).join(` ${joinOperator} `);
|
|
570
|
+
const branchConditions = entries.map(([k, v]) => buildCondition(k, v, parentPath));
|
|
571
|
+
return branchConditions.length === 1 ? branchConditions[0] : `(${branchConditions.join(" AND ")})`;
|
|
584
572
|
}).join(` ${joinOperator} `);
|
|
585
573
|
const operatorFn = FILTER_OPERATORS[key];
|
|
586
574
|
return operatorFn(joined, 0, value).sql;
|