Skip to content

fix: make $queryRawTyped conditional on typedSql preview feature#21

Merged
m9tdev merged 1 commit into
mainfrom
m9tdev/check-gh-issues
Mar 9, 2026
Merged

fix: make $queryRawTyped conditional on typedSql preview feature#21
m9tdev merged 1 commit into
mainfrom
m9tdev/check-gh-issues

Conversation

@m9tdev

@m9tdev m9tdev commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes issue #20 where $queryRawTyped was always generated, causing TypeScript errors when the typedSql preview feature wasn't enabled. The generator now detects whether typedSql is available and only generates the method when it's present.

Changes

  • Detect typedSql preview feature across all Prisma generators
  • Conditionally generate $queryRawTyped only when enabled
  • Conditionally import @prisma/client/runtime/client only when needed
  • Added tests to verify presence/absence based on configuration

Testing

All existing tests pass, plus new tests verify the feature works correctly in both configurations.

…eature

Fixes issue #20 where $queryRawTyped was always generated even when the
typedSql preview feature was not enabled, causing TypeScript errors.

The generator now detects whether any Prisma generator has the typedSql
preview feature enabled and only generates $queryRawTyped and imports the
runtime module when it's available.

Added tests to verify:
- $queryRawTyped is generated when typedSql is enabled
- $queryRawTyped is not generated when typedSql is not enabled
@m9tdev m9tdev merged commit 60675e5 into main Mar 9, 2026
1 check passed
@m9tdev m9tdev deleted the m9tdev/check-gh-issues branch March 9, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant