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