Skip to content

Commit

Permalink
slight tweaks to title and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell committed Aug 1, 2024
1 parent 7d8cbfb commit 59a5195
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tocDepth: 3

:::warning

With Prisma ORM 5.18.0, we have released [TypedSQL](/orm/prisma-client/writing-custom-sql). TypedSQL is a new way to write type-safe SQL queries that are type-safe and even easier to add to your workflow. Whenever possible, we recommend using TypedSQL queries over legacy raw queries.
With Prisma ORM 5.18.0, we have released [TypedSQL](/orm/prisma-client/writing-custom-sql). TypedSQL is a new way to write type-safe SQL queries that are type-safe and even easier to add to your workflow. We strongly recommend using TypedSQL queries over the legacy raw queries described in this document whenever possible. The following information is maintained for backward compatibility and specific use cases where TypedSQL may not be applicable.

:::

Expand Down Expand Up @@ -797,11 +797,11 @@ prisma.$runCommandRaw({
})
```
<Admonition type="warning">
:::warning
Do not use `$runCommandRaw()` for queries which contain the `"find"` or `"aggregate"` commands, because you might be unable to fetch all data. This is because MongoDB returns a [cursor](https://docs.mongodb.com/manual/tutorial/iterate-a-cursor/) that is attached to your MongoDB session, and you might not hit the same MongoDB session every time. For these queries, you should use the specialised [`findRaw()`](#findraw) and [`aggregateRaw()`](#aggregateraw) methods instead.
</Admonition>
:::
#### Return type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Writing SQL'
metaTitle: 'Writing Custom SQL in Prisma Client'
metaDescription: 'Learn how to use your own custom SQL queries in Prisma Client.'
title: 'Using Raw SQL'
metaTitle: 'Using Raw SQL in Prisma Client'
metaDescription: 'Learn how to use raw SQL queries in Prisma Client.'
hide_table_of_contents: true
---

Expand All @@ -23,7 +23,7 @@ TypedSQL is available in Prisma ORM 5.18.0 and later. For raw database access in

### What is TypedSQL?

TypedSQL is new feature in Prisma ORM that bridges the gap between raw SQL and type-safe TypeScript code. It allows you to write SQL queries in dedicated `.sql` files while leveraging the full type safety and developer experience of Prisma Client.
TypedSQL is a feature in Prisma ORM that bridges the gap between raw SQL and type-safe TypeScript code. It allows you to write SQL queries in dedicated `.sql` files while leveraging the full type safety and developer experience of Prisma Client.

With TypedSQL, you can:

Expand All @@ -42,11 +42,13 @@ By using TypedSQL, you can write efficient, type-safe database queries without s

For a detailed guide on how to get started with TypedSQL, including setup instructions and usage examples, please refer to our [TypedSQL documentation](/orm/prisma-client/writing-custom-sql/typedsql).

## Raw SQL queries
## Raw queries

Prior to version 5.18.0, Prisma Client only supported raw SQL queries that were not type-safe and required manual mapping of the query result to the desired type. While not as ergonomic as [TypedSQL](#writing-type-safe-queries-with-prisma-client-and-typedsql), these queries are still supported and are useful when a query is dynamically generated.
Prior to version 5.18.0, Prisma Client only supported raw SQL queries that were not type-safe and required manual mapping of the query result to the desired type.

### Legacy raw queries in relational databases
While not as ergonomic as [TypedSQL](#writing-type-safe-queries-with-prisma-client-and-typedsql), these queries are still supported and are useful when TypedSQL queries are not possible either due to features not yet supported in TypedSQL or when the query is dynamically generated.

### Legacy raw SQL queries in relational databases

Prisma ORM supports four methods to execute raw SQL queries in relational databases:

Expand Down

0 comments on commit 59a5195

Please sign in to comment.