prisma-sql 1.16.0 → 1.18.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.
@@ -56,7 +56,7 @@ var require_package = __commonJS({
56
56
  "package.json"(exports$1, module) {
57
57
  module.exports = {
58
58
  name: "prisma-sql",
59
- version: "1.16.0",
59
+ version: "1.18.0",
60
60
  description: "Convert Prisma queries to optimized SQL with type safety. 2-7x faster than Prisma Client.",
61
61
  main: "dist/index.cjs",
62
62
  module: "dist/index.js",
@@ -119,13 +119,14 @@ var require_package = __commonJS({
119
119
  license: "MIT",
120
120
  dependencies: {
121
121
  "@dee-wan/schema-parser": "1.3.0",
122
+ "@prisma/client": "6.16.3",
122
123
  "@prisma/generator-helper": "^7.2.0",
123
124
  "@prisma/internals": "^7.2.0"
124
125
  },
125
126
  devDependencies: {
126
127
  "@faker-js/faker": "^10.2.0",
127
- "@prisma/adapter-better-sqlite3": "^7.2.0",
128
- "@prisma/adapter-pg": "^7.2.0",
128
+ "@prisma/adapter-better-sqlite3": "^6.16.3",
129
+ "@prisma/adapter-pg": "^6.16.3",
129
130
  "@prisma/client": "7.2.0",
130
131
  "@types/better-sqlite3": "^7.6.13",
131
132
  "@types/node": "^20.0.0",
@@ -1825,7 +1826,15 @@ function buildOperator(expr, op, val, ctx, mode, fieldType) {
1825
1826
  return buildArrayOperator(expr, op, val, ctx.params, fieldType, ctx.dialect);
1826
1827
  }
1827
1828
  if (fieldType && isJsonType(fieldType)) {
1828
- return buildJsonOperator(expr, op, val, ctx.params, ctx.dialect);
1829
+ const JSON_OPS = /* @__PURE__ */ new Set([
1830
+ Ops.PATH,
1831
+ Ops.STRING_CONTAINS,
1832
+ Ops.STRING_STARTS_WITH,
1833
+ Ops.STRING_ENDS_WITH
1834
+ ]);
1835
+ if (JSON_OPS.has(op)) {
1836
+ return buildJsonOperator(expr, op, val, ctx.params, ctx.dialect);
1837
+ }
1829
1838
  }
1830
1839
  return buildScalarOperator(
1831
1840
  expr,
@@ -4600,7 +4609,7 @@ export function createExtension(config: {
4600
4609
  return this.$parent[modelName][method](args)
4601
4610
  }
4602
4611
 
4603
- const result = buildSQL(model, MODELS, method, args, DIALECT)
4612
+ const result = buildSQL(model, MODELS, method, args || {}, DIALECT)
4604
4613
  sql = result.sql
4605
4614
  params = result.params
4606
4615
  }