@mastra/pg 1.14.1 → 1.14.2-alpha.0
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/CHANGELOG.md +31 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- 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
|
@@ -160,7 +160,7 @@ var createNumericOperator = (symbol) => {
|
|
|
160
160
|
const isNumeric = typeof value === "number" || typeof value === "string" && !isNaN(Number(value)) && value.trim() !== "";
|
|
161
161
|
if (isNumeric) {
|
|
162
162
|
return {
|
|
163
|
-
sql: `(metadata#>>'{${jsonPathKey}}')::numeric ${symbol} $${paramIndex}::numeric`,
|
|
163
|
+
sql: `(CASE WHEN jsonb_typeof(metadata#>'{${jsonPathKey}}') = 'number' THEN (metadata#>>'{${jsonPathKey}}')::numeric ${symbol} $${paramIndex}::numeric ELSE FALSE END)`,
|
|
164
164
|
needsValue: true
|
|
165
165
|
};
|
|
166
166
|
} else {
|
|
@@ -201,7 +201,7 @@ function buildElemMatchConditions(value, paramIndex) {
|
|
|
201
201
|
throw new Error(`Invalid operator: ${paramOperator}`);
|
|
202
202
|
}
|
|
203
203
|
const result = operatorFn(paramKey, nextParamIndex, paramValue);
|
|
204
|
-
const sql = result.sql.replaceAll("metadata#>>", "elem#>>");
|
|
204
|
+
const sql = result.sql.replaceAll("metadata#>>", "elem#>>").replaceAll("metadata#>", "elem#>");
|
|
205
205
|
conditions.push(sql);
|
|
206
206
|
if (result.needsValue) {
|
|
207
207
|
values.push(paramValue);
|