prisma-sql 1.33.0 → 1.35.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.33.0",
59
+ version: "1.35.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",
@@ -4639,12 +4639,9 @@ function generateCode(models, queries, dialect) {
4639
4639
  fields: model.fields.filter((f) => f !== void 0 && f !== null)
4640
4640
  }));
4641
4641
  return `// Generated by @prisma-sql/generator - DO NOT EDIT
4642
- import { buildSQL, transformQueryResults, type PrismaMethod } from 'prisma-sql'
4642
+ import { buildSQL, transformQueryResults, type PrismaMethod, type Model } from 'prisma-sql'
4643
4643
 
4644
- // Export models for advanced use cases (createToSQL, etc)
4645
- export const MODELS = ${JSON.stringify(cleanModels, null, 2)} as const
4646
-
4647
- export type Models = typeof MODELS
4644
+ export const MODELS: Model[] = ${JSON.stringify(cleanModels, null, 2)}
4648
4645
 
4649
4646
  const QUERIES: Record<string, Record<string, Record<string, {
4650
4647
  sql: string
@@ -4756,7 +4753,6 @@ export function speedExtension(config: {
4756
4753
  prebaked: boolean
4757
4754
  }) => void
4758
4755
  }) {
4759
- // models is NOT a parameter - uses internal MODELS
4760
4756
  const { postgres, sqlite, debug, onQuery } = config
4761
4757
 
4762
4758
  if (!postgres && !sqlite) {
@@ -4787,8 +4783,7 @@ export function speedExtension(config: {
4787
4783
  params = [...prebakedQuery.params, ...extractDynamicParams(args, prebakedQuery.dynamicKeys)]
4788
4784
  prebaked = true
4789
4785
  } else {
4790
- // Use internal MODELS directly
4791
- const model = MODELS.find((m: any) => m.name === modelName)
4786
+ const model = MODELS.find((m) => m.name === modelName)
4792
4787
 
4793
4788
  if (!model) {
4794
4789
  return this.$parent[modelName][method](args)