diff options
author | 2023-09-28 11:31:47 -0700 | |
---|---|---|
committer | 2023-09-28 11:31:47 -0700 | |
commit | 5fedc8bd6c84d26d283e1c6c300191e6ec388112 (patch) | |
tree | 24dde83cf812481b6d1c8de316a30ece7b745a54 | |
parent | e62fef67658240a4137320729ff26e09498a93fd (diff) | |
download | bun-5fedc8bd6c84d26d283e1c6c300191e6ec388112.tar.gz bun-5fedc8bd6c84d26d283e1c6c300191e6ec388112.tar.zst bun-5fedc8bd6c84d26d283e1c6c300191e6ec388112.zip |
Revert "Update prisma guide"
This reverts commit e62fef67658240a4137320729ff26e09498a93fd.
-rw-r--r-- | docs/guides/ecosystem/prisma.md | 41 | ||||
m--------- | src/bun.js/WebKit | 0 |
2 files changed, 9 insertions, 32 deletions
diff --git a/docs/guides/ecosystem/prisma.md b/docs/guides/ecosystem/prisma.md index af83a47e4..08d56440d 100644 --- a/docs/guides/ecosystem/prisma.md +++ b/docs/guides/ecosystem/prisma.md @@ -11,17 +11,17 @@ name: Get started using Prisma Prisma works out of the box with Bun. First, create a directory and initialize it with `bun init`. ```bash -$ mkdir prisma-app -$ cd prisma-app -$ bun init +mkdir prisma-app +cd prisma-app +bun init ``` --- -Then install the Prisma CLI (`prisma`) and Prisma Client (`@prisma/client`) as dependencies. +Then add Prisma as a dependency. ```bash -$ bun add prisma @prisma/client +bun add prisma ``` --- @@ -29,7 +29,7 @@ $ bun add prisma @prisma/client We'll use the Prisma CLI with `bunx` to initialize our schema and migration directory. For simplicity we'll be using an in-memory SQLite database. ```bash -$ bunx prisma init --datasource-provider sqlite +bunx prisma init --datasource-provider sqlite ``` --- @@ -60,37 +60,14 @@ Then generate and run initial migration. This will generate a `.sql` migration file in `prisma/migrations`, create a new SQLite instance, and execute the migration against the new instance. ```bash -$ bunx prisma migrate dev --name init -Environment variables loaded from .env -Prisma schema loaded from prisma/schema.prisma -Datasource "db": SQLite database "dev.db" at "file:./dev.db" - -SQLite database dev.db created at file:./dev.db - -Applying migration `20230928182242_init` - -The following migration(s) have been created and applied from new schema changes: - -migrations/ - └─ 20230928182242_init/ - └─ migration.sql - -Your database is now in sync with your schema. - -✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 41ms +bunx prisma migrate dev --name init ``` --- -As indicated in the output, Prisma re-generates our _Prisma client_ whenever we execute a new migration. The client provides a fully typed API for reading and writing from our database. You can manually re-generate the client with the Prisma CLI. - -```sh -$ bunx prisma generate -``` - ---- +Prisma automatically generates our _Prisma client_ whenever we execute a new migration. The client provides a fully typed API for reading and writing from our database. -We can import the generated client from `@prisma/client`. +It can be imported from `@prisma/client`. ```ts#src/index.ts import {PrismaClient} from "@prisma/client"; diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit -Subproject e1aa0a58e282b53fc20503d6e7ec93c621bc557 +Subproject 6ee85cc2dc431e146723885bc73ac14f33e0d82 |