prisma-sql 1.14.0 → 1.15.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.14.0",
57
+ version: "1.15.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",
@@ -116,7 +116,7 @@ var require_package = __commonJS({
116
116
  author: "multipliedtwice <multipliedtwice@gmail.com>",
117
117
  license: "MIT",
118
118
  dependencies: {
119
- "@dee-wan/schema-parser": "1.2.0",
119
+ "@dee-wan/schema-parser": "1.3.0",
120
120
  "@prisma/generator-helper": "^7.2.0",
121
121
  "@prisma/internals": "^7.2.0"
122
122
  },
@@ -4183,14 +4183,6 @@ function safeAlias(input) {
4183
4183
  }
4184
4184
  return base;
4185
4185
  }
4186
- function isPrismaMethod(v) {
4187
- return v === "findMany" || v === "findFirst" || v === "findUnique" || v === "aggregate" || v === "groupBy" || v === "count";
4188
- }
4189
- function getMethodFromProcessed(processed) {
4190
- const maybe = processed == null ? void 0 : processed.method;
4191
- if (isPrismaMethod(maybe)) return maybe;
4192
- return "findMany";
4193
- }
4194
4186
  function buildSqlResult(args) {
4195
4187
  const {
4196
4188
  method,
@@ -4303,6 +4295,7 @@ function buildMainWhere(args) {
4303
4295
  }
4304
4296
  function buildAndNormalizeSql(args) {
4305
4297
  const {
4298
+ method,
4306
4299
  processed,
4307
4300
  whereResult,
4308
4301
  tableName,
@@ -4311,7 +4304,6 @@ function buildAndNormalizeSql(args) {
4311
4304
  schemaModels,
4312
4305
  dialect
4313
4306
  } = args;
4314
- const method = getMethodFromProcessed(processed);
4315
4307
  const sqlResult = buildSqlResult({
4316
4308
  method,
4317
4309
  processed,
@@ -4333,7 +4325,7 @@ function finalizeDirective(args) {
4333
4325
  validateSqlPositions(normalizedSql, normalizedMappings, getGlobalDialect());
4334
4326
  const { staticParams, dynamicKeys } = buildParamsFromMappings(normalizedMappings);
4335
4327
  return {
4336
- header: directive.header,
4328
+ method: directive.method,
4337
4329
  sql: normalizedSql,
4338
4330
  staticParams,
4339
4331
  dynamicKeys,
@@ -4353,7 +4345,9 @@ function generateSQL(directive) {
4353
4345
  modelDef,
4354
4346
  dialect
4355
4347
  });
4348
+ const method = directive.method;
4356
4349
  const normalized = buildAndNormalizeSql({
4350
+ method,
4357
4351
  processed: query.processed,
4358
4352
  whereResult,
4359
4353
  tableName,
@@ -4394,7 +4388,7 @@ function generateClient(options) {
4394
4388
  const modelQueries = queries.get(modelName);
4395
4389
  for (const directive of result.directives) {
4396
4390
  try {
4397
- const method = directive.header;
4391
+ const method = directive.method;
4398
4392
  const sqlDirective = generateSQL2(directive);
4399
4393
  if (!modelQueries.has(method)) {
4400
4394
  modelQueries.set(method, /* @__PURE__ */ new Map());