@graffy/pg 0.15.15-alpha.1 → 0.15.16

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.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -289,7 +289,7 @@ function getBinarySql(lhs, type, op, value) {
289
289
  return sql__default["default"]`${lhs} ${sqlOp} (${sql.join(value)})`;
290
290
  }
291
291
  if (op === "$re" || op === "$ire") {
292
- const castLhs = type === "text" ? lhs : sql__default["default"]`(${lhs})::text`;
292
+ const castLhs = type === "text" ? lhs : type === "jsonb" ? sql__default["default"]`(${lhs})#>>'{}'` : sql__default["default"]`(${lhs})::text`;
293
293
  return sql__default["default"]`${castLhs} ${sqlOp} ${String(value)}`;
294
294
  }
295
295
  if (type === "jsonb") {
package/index.mjs CHANGED
@@ -281,7 +281,7 @@ function getBinarySql(lhs, type, op, value) {
281
281
  return sql`${lhs} ${sqlOp} (${join(value)})`;
282
282
  }
283
283
  if (op === "$re" || op === "$ire") {
284
- const castLhs = type === "text" ? lhs : sql`(${lhs})::text`;
284
+ const castLhs = type === "text" ? lhs : type === "jsonb" ? sql`(${lhs})#>>'{}'` : sql`(${lhs})::text`;
285
285
  return sql`${castLhs} ${sqlOp} ${String(value)}`;
286
286
  }
287
287
  if (type === "jsonb") {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/pg",
3
3
  "description": "The standard Postgres module for Graffy. Each instance this module mounts a Postgres table as a Graffy subtree.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.15.15-alpha.1",
5
+ "version": "0.15.16",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
- "@graffy/common": "0.15.15-alpha.1",
19
+ "@graffy/common": "0.15.16",
20
20
  "sql-template-tag": "^4.0.0",
21
21
  "debug": "^4.3.2"
22
22
  },