Skip to content

feat: add support for Prisma TypedSQL ($queryRawTyped)#18

Merged
m9tdev merged 1 commit intomainfrom
m9tdev/prisma-typed-queries
Feb 5, 2026
Merged

feat: add support for Prisma TypedSQL ($queryRawTyped)#18
m9tdev merged 1 commit intomainfrom
m9tdev/prisma-typed-queries

Conversation

@m9tdev
Copy link
Owner

@m9tdev m9tdev commented Feb 5, 2026

Summary

  • Adds $queryRawTyped method to the generated PrismaService for type-safe raw SQL queries using Prisma's TypedSQL feature
  • Wraps Prisma's $queryRawTyped with Effect, supporting transaction context via clientOrTx
  • Uses standard error handling pattern with mapError

Test plan

  • Added integration test for basic $queryRawTyped usage
  • Added integration test for $queryRawTyped within transactions
  • All 10 tests pass

Note

When using @prisma/adapter-better-sqlite3, SQL queries must use ? placeholders instead of $1 syntax. The @param annotation still uses $1:name for Prisma's type generation.

🤖 Generated with Claude Code

Adds `$queryRawTyped` method to the generated PrismaService for type-safe
raw SQL queries using Prisma's TypedSQL feature.

Changes:
- Add `$queryRawTyped` wrapper that accepts TypedSql queries
- Enable `typedSql` preview feature in test schema
- Add integration tests for TypedSQL usage and transactions
- Update test script to use `prisma generate --sql`

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@m9tdev m9tdev merged commit b3de18c into main Feb 5, 2026
1 check passed
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