Skip to content

Commit

Permalink
Add filenames to TypeScript files in TypedSQL docs (#6236)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Harrell <[email protected]>
  • Loading branch information
karlhorky and jharrell authored Sep 13, 2024
1 parent f711621 commit 56ebabc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ To pass arguments to your TypedSQL queries, you can use parameterized queries. T

1. When using the generated function in your TypeScript code, pass the arguments as additional parameters to `$queryRawTyped`:

```typescript
```typescript title="/src/index.ts"
import { PrismaClient } from '@prisma/client'
import { getUsersByAge } from '@prisma/client/sql'

Expand All @@ -140,7 +140,7 @@ FROM users
WHERE id = ANY($1)
```

```typescript
```typescript title="/src/index.ts"
import { PrismaClient } from '@prisma/client'
import { getUsersByIds } from '@prisma/client/sql'

Expand Down Expand Up @@ -221,4 +221,4 @@ In this example, the columns to be selected are defined dynamically and included

## Acknowledgements

This feature was heavily inspired by [PgTyped](https://github.com/adelsz/pgtyped) and [SQLx](https://github.com/launchbadge/sqlx). Additionally, SQLite parsing is handled by SQLx.
This feature was heavily inspired by [PgTyped](https://github.com/adelsz/pgtyped) and [SQLx](https://github.com/launchbadge/sqlx). Additionally, SQLite parsing is handled by SQLx.

0 comments on commit 56ebabc

Please sign in to comment.