Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update drizzle docs to include PlanetScale instructions #1614

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/tough-mice-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
29 changes: 27 additions & 2 deletions www/src/pages/en/usage/drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ isMdx: true
import Callout from "../../../components/docs/callout.tsx";

<Callout type="info">
The `drizzle` option is a new addition and no docs have yet been written. Contributions are welcome!

The `drizzle` option is a new addition and only a small subset of the docs have been written. Contributions are welcome!
</Callout>

## Configure PlanetScale

### Setup database credentials in .env

1. Generate a new username + password & select "connect with Prisma"
2. Copy the `DATABASE_URL` (which looks like: `DATABASE_URL='mysql:https://<user>:<pass>@<host>/<db-name>?sslaccept=strict'
`) and paste it into your `.env`
3. Replace `?sslaccept=strict` with `ssl={"rejectUnauthorized":true}`

### Update package.json `db*:` generate script

1. Replace `:psql` with `:mysql`.

### Update drizzle.config.ts

1. Use the mysql2 driver: `driver: "mysql2",`

### Run migrations

1. Generate the migrations using `yarn db:generate`
2. Push them to PlanetScale using `yarn db:push`

#### Seeing a timeout error?

1. Are you on a VPN? This may be disrupting the connection.