Skip to content

Commit

Permalink
add typed sql video
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Aug 27, 2024
1 parent 025c9ee commit 3fb1514
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/typed-sql/README.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Typed SQL

<EpicVideo url="https://www.epicweb.dev/tips/prisma-typed-sql-queries" />

This is an example of using Prisma Client's 5.19.0 `prisma.$queryRawTyped` for
our search page instead of using zod for type safety.
17 changes: 17 additions & 0 deletions exercises/08.sql/04.solution.order/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,20 @@ back! (I would, but I'm just a 👨‍💼 emoji).
`prisma.$queryRaw`. Prisma is pretty powerful by itself and most of the time you
don't need to reach for raw SQL statements. But when you do, you'll be glad that
you could.

---

## Typed SQL

An exciting new feature in Prisma 5.19.0 is the `prisma.$queryRawTyped`
function. This allows you to run raw SQL queries and get typed results back
from your database.

This is a game changer for type safety and developer experience. Check out how
this exercise changes with this new feature here:

<EpicVideo url="https://www.epicweb.dev/tips/prisma-typed-sql-queries" />

<DiffLink app1="08/04.solution" app2="example.typed-sql">
See the diff here
</DiffLink>

0 comments on commit 3fb1514

Please sign in to comment.