Skip to content

Commit

Permalink
Small changes to the TS ORM docs (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-johansson authored Nov 19, 2024
1 parent 66c5d6a commit b041781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
7 changes: 2 additions & 5 deletions docs/ts/develop/orms/drizzle.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Using Drizzle ORM with Encore
lang: ts
---
Encore.ts supports integrating [Drizzle](https://orm.drizzle.team/), a TypeScript ORM for Node.js and the browser. To use Drizzle with Encore, start by creating a `SQLDatabase` instance and providing the connection string to Drizzle.

<GitHubLink href="https://github.com/encoredev/examples/tree/main/ts/drizzle" desc="Using Drizzle ORM with Encore.ts" />

## 1. Setting Up the Database Connection

Expand Down Expand Up @@ -74,8 +76,3 @@ drizzle-kit generate
## 5. Applying Migrations

Migrations are automatically applied when you run your Encore application, so you don’t need to run `drizzle-kit migrate` or any similar commands manually.

---

For more details, see the example on GitHub:
<GitHubLink href="https://github.com/encoredev/examples/tree/main/ts/drizzle" desc="Using Drizzle ORM with Encore.ts" />
14 changes: 6 additions & 8 deletions docs/ts/develop/orms/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ title: Using Prisma with Encore.ts
lang: ts
---

### Prisma

With Prisma you make your schema changes in a Prisma schema file `schema.prisma`, and then use Prisma's CLI tools to generate SQL migrations and a TypeScript ORM client.

Here is an example of using [Prisma](https://prisma.io/) with Encore.ts. We use `DB.connectionString` to supply the connection string to Prisma:
Expand Down Expand Up @@ -56,6 +54,12 @@ model User {
}
```

<GitHubLink
href="https://github.com/encoredev/examples/tree/main/ts/prisma"
desc="Using Prisma ORM with Encore.ts"
/>


## Configure Prisma

Prisma requires a "shadow database" for certain operations, essentially it's a second, temporary, database that is created and deleted automatically. Encore comes with built-in support for shadow databases, and by configuring Prisma to operate on Encore's shadow database, Encore.ts and Prisma won't interfere with each other. You can then use the Prisma CLI to generate migrations and the ORM client. Encore will take care of applying the migrations both in production and locally.
Expand Down Expand Up @@ -106,9 +110,3 @@ This will create new migrations if you have made any changes to the `schema.pris
## Migration

The migration files will be automatically applied by Encore, both locally (when you run `encore run`) and in cloud environments.


<GitHubLink
href="https://github.com/encoredev/examples/tree/main/ts/prisma"
desc="Using Prisma ORM with Encore.ts"
/>

0 comments on commit b041781

Please sign in to comment.