prisma-sql 1.16.0 → 1.17.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.17.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,15 @@ 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
- "@prisma/internals": "^7.2.0"
124
+ "@prisma/internals": "^7.2.0",
125
+ prisma: "6.16.3"
124
126
  },
125
127
  devDependencies: {
126
128
  "@faker-js/faker": "^10.2.0",
127
- "@prisma/adapter-better-sqlite3": "^7.2.0",
128
- "@prisma/adapter-pg": "^7.2.0",
129
+ "@prisma/adapter-better-sqlite3": "^6.16.3",
130
+ "@prisma/adapter-pg": "^6.16.3",
129
131
  "@prisma/client": "7.2.0",
130
132
  "@types/better-sqlite3": "^7.6.13",
131
133
  "@types/node": "^20.0.0",
@@ -1825,7 +1827,15 @@ function buildOperator(expr, op, val, ctx, mode, fieldType) {
1825
1827
  return buildArrayOperator(expr, op, val, ctx.params, fieldType, ctx.dialect);
1826
1828
  }
1827
1829
  if (fieldType && isJsonType(fieldType)) {
1828
- return buildJsonOperator(expr, op, val, ctx.params, ctx.dialect);
1830
+ const JSON_OPS = /* @__PURE__ */ new Set([
1831
+ Ops.PATH,
1832
+ Ops.STRING_CONTAINS,
1833
+ Ops.STRING_STARTS_WITH,
1834
+ Ops.STRING_ENDS_WITH
1835
+ ]);
1836
+ if (JSON_OPS.has(op)) {
1837
+ return buildJsonOperator(expr, op, val, ctx.params, ctx.dialect);
1838
+ }
1829
1839
  }
1830
1840
  return buildScalarOperator(
1831
1841
  expr,
@@ -4600,7 +4610,7 @@ export function createExtension(config: {
4600
4610
  return this.$parent[modelName][method](args)
4601
4611
  }
4602
4612
 
4603
- const result = buildSQL(model, MODELS, method, args, DIALECT)
4613
+ const result = buildSQL(model, MODELS, method, args || {}, DIALECT)
4604
4614
  sql = result.sql
4605
4615
  params = result.params
4606
4616
  }