@mastra/pg 1.30.0-alpha.3 → 1.30.0-alpha.4

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.
@@ -3,7 +3,7 @@ name: mastra-pg
3
3
  description: Documentation for @mastra/pg. Use when working with @mastra/pg APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/pg"
6
- version: "1.30.0-alpha.3"
6
+ version: "1.30.0-alpha.4"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.30.0-alpha.3",
2
+ "version": "1.30.0-alpha.4",
3
3
  "package": "@mastra/pg",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -341,13 +341,9 @@ const FILTER_OPERATORS = {
341
341
  };
342
342
  },
343
343
  $exists: (key, paramIndex, value) => {
344
- const jsonPathKey = parseJsonPathKey(key);
345
- if (value === false) return {
346
- sql: `NOT (metadata ? '${jsonPathKey}')`,
347
- needsValue: false
348
- };
344
+ const existsSql = key.includes(".") ? `${getJsonExtractExpr(key)} IS NOT NULL` : `metadata ? '${parseJsonPathKey(key)}'`;
349
345
  return {
350
- sql: `metadata ? '${jsonPathKey}'`,
346
+ sql: value === false ? `NOT (${existsSql})` : existsSql,
351
347
  needsValue: false
352
348
  };
353
349
  },