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