aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/ecosystem
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guides/ecosystem')
-rw-r--r--docs/guides/ecosystem/prisma.md41
1 files changed, 32 insertions, 9 deletions
diff --git a/docs/guides/ecosystem/prisma.md b/docs/guides/ecosystem/prisma.md
index 08d56440d..af83a47e4 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 add Prisma as a dependency.
+Then install the Prisma CLI (`prisma`) and Prisma Client (`@prisma/client`) as dependencies.
```bash
-bun add prisma
+$ bun add prisma @prisma/client
```
---
@@ -29,7 +29,7 @@ bun add prisma
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,14 +60,37 @@ 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
+$ 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
```
---
-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.
+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
+```
+
+---
-It can be imported from `@prisma/client`.
+We can import the generated client from `@prisma/client`.
```ts#src/index.ts
import {PrismaClient} from "@prisma/client";
>
path: root/docs (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2021-08-03Fix portfolio example (#987)Gravatar Maksim Markelov 1-1/+1
2021-08-03Improve Collection docs for RSS (#990)Gravatar Joshua Stübner 1-1/+5
- Added missing but required link attribute - Added note on how to create a full text feed
2021-08-03Improve code sample for lit integration (#991)Gravatar tobi-or-not-tobi 1-4/+6
Align the lit component with the astro import and usage of it.
2021-08-03fix: Exclude remote srcset URLs (#986)Gravatar Maarten Van Hoof 2-1/+8
* fix: Exclude remote srcset URLs Fixed #985 * chore: add changeset for 'Exclude remote srcset URLs'
2021-08-03Make Astro.request available to all astro components (#960)Gravatar Matthew Phillips 7-15/+53
* Make Astro.request available to all astro components * Adds a changeset
2021-08-02Add `lang` variable to docs frontmatter for translations (#984)Gravatar Caleb Jasik 4-0/+4
2021-08-01Update styling.md re link-handling for .scss files (#977)Gravatar Bryce Wray 1-1/+3
Adding a note to make clear that users of .scss files should still link to the final compiled .css files, as per https://discord.com/channels/830184174198718474/853350631389265940/871151798075949066.
2021-08-01add support for 4-letter language codes (ex: zh-TW)Gravatar Fred K. Schott 1-1/+1
2021-08-02[ci] yarn formatGravatar FredKSchott 3-11/+10
2021-08-01full translation (#967)Gravatar Fred K. Schott 9-83/+85
2021-08-01Update CONTRIBUTING.mdGravatar Fred K. Schott 1-3/+3
2021-08-02[ci] yarn formatGravatar FredKSchott 1-3/+1
2021-08-01Update and rename contributing.md to CONTRIBUTING.mdGravatar Fred K. Schott 1-0/+29
2021-08-01Delete COMMUNITY.mdGravatar Fred K. Schott 1-15/+0
2021-07-31fix bad merge from outdated layoutGravatar Fred K. Schott 3-3/+3
2021-07-30Fixes throwing 404 (#894)Gravatar Maciej Palmowski 1-3/+0
* Fixes throwing 404 * Update index.css Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-07-30small cleanup to installation docsGravatar Fred K. Schott 1-9/+6
2021-07-30add finnish to language selectorGravatar Fred K. Schott 2-2/+5
2021-07-30move finnish translations to fiGravatar Fred K. Schott 3-0/+0
2021-07-30WIP: Documentation in Finnish (#837)Gravatar Vesa Piittinen 3-0/+201
* Initial Finnish getting-started.md * Initial Finnish `quick-start.md` * Missing word * Use a different test path name * Initial Finnish `installation.md` * Sync with `installation.md` * WIP Finnish island-architecture.md * Fix some sillyness * Delete island-architecture.md Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-07-30📘 DOC: Add PostCSS configuration on Astro (#947)Gravatar Diogo Felix 1-0/+27
2021-07-30fix styling URL linkGravatar Fred K. Schott 1-1/+1
2021-07-31[ci] yarn formatGravatar FredKSchott 6-36/+61
2021-07-30fix styling guide (#961)Gravatar Rubens de Melo 1-1/+1
* fix styling guide fix styling guide * remove /docs remove /docs
2021-07-30Add svelte file extension to tailwind puge configuration. (#964)Gravatar allanvobraun 1-1/+1
Self explanatory.
2021-07-30Docs site cleanup (#948)Gravatar Fred K. Schott 57-730/+739
* add language selector * docs site cleanup * review feedback * code review comments
2021-07-30Ascii quotes (#928)Gravatar Marcus Otterström 8-63/+63
2021-07-30forced degit template extraction in case of non empty installation directory ↵Gravatar mash-graz 2-23/+7
(#937) * revert recursive file removal routine * forced degit overwrite without previous file removal * add changeset
2021-07-30Version Packages (#940)Gravatar github-actions[bot] 26-34/+45
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-07-30[ci] yarn formatGravatar matthewp 1-1/+1
2021-07-30Fix Vue components nesting and add tests (#924)Gravatar Bartek Igielski 10-34/+171
* Allow @vue/server-renderer to be processed * Bump @vue/server-renderer version * Create twenty-coats-talk.md * Bump Vue packages version to get ESM builds * Add Vue components tests * Create shaggy-pugs-raise.md * Delete shaggy-pugs-raise.md
2021-07-30[ci] yarn formatGravatar FredKSchott 1-1/+0
2021-07-30Fix typos and clarify docs (#880)Gravatar Marcus Otterström 4-4/+5
* Add more missing words * Add missing dot * Add another missing dot * Clarify what optimized css means (discussed on Discord) * Remove oxford comma Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-07-29move translated nl docsGravatar Fred K. Schott 3-1/+1