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