-
Notifications
You must be signed in to change notification settings - Fork 871
feat: update prisma init related changes in other parts #7267
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b79b608
feat: add kysley
ankur-arch 10f9cfb
feat: add drizzle
ankur-arch f14117b
feat: add typeorm
ankur-arch e3d0273
fix: clean-up
ankur-arch eb0d9ed
fix: update prisma init command changes
ankur-arch 97eba07
feat: update prisma cli docs
ankur-arch c1c8a27
fix: clarify the usage of prisma init better
ankur-arch 02c0aa8
Merge branch 'prisma-7' into DC-6236-init-command-change
ankur-arch e4cf39f
fix: add type defs
ankur-arch 17b67d7
feat: add pg as a dependency
ankur-arch 96b202e
fix: broken internal link
ankur-arch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,30 +31,57 @@ npx prisma@latest init --db | |
| <cmdResult> | ||
|
|
||
| ```code no-copy wrap | ||
| Success! Your Prisma Postgres database is ready ✅ | ||
| ✓ Select an authentication method Google | ||
| Authenticating to Prisma Platform via browser. | ||
|
|
||
| We created an initial schema.prisma file and a .env file with your DATABASE_URL environment variable already set. | ||
| Visit the following URL in your browser to authenticate: | ||
| https://console.prisma.io/auth/cli?state=eyJjb6ll... | ||
|
|
||
| Successfully authenticated as [email protected]. | ||
| Let's set up your Prisma Postgres database! | ||
| ✓ Select your region: ap-southeast-1 - Asia Pacific (Singapore) | ||
| ✓ Enter a project name: My Prisma Project | ||
| ✓ Success! Your Prisma Postgres database is ready ✅ | ||
|
|
||
| We found an existing schema.prisma file in your current project directory. | ||
|
|
||
| --- Database URL --- | ||
|
|
||
| Connect Prisma ORM to your Prisma Postgres database with this URL: | ||
|
|
||
| --- Next steps --- | ||
|
|
||
| Go to https://pris.ly/ppg-init for detailed instructions. | ||
|
|
||
| 1. Define your database schema | ||
| Open the schema.prisma file and define your first models. Check the docs if you need inspiration: https://pris.ly/ppg-init | ||
| 1. Install the Postgres adapter | ||
| npm install @prisma/adapter-pg | ||
|
|
||
| ...and add it to your Prisma Client instance: | ||
|
|
||
| import { PrismaClient } from "./generated/prisma/client"; | ||
| import { PrismaPg } from "@prisma/adapter-pg"; | ||
|
|
||
| const connectionString = `${process.env.DATABASE_URL}`; | ||
|
|
||
| const adapter = new PrismaPg({ connectionString }); | ||
| const prisma = new PrismaClient({ adapter }); | ||
|
|
||
| 2. Apply migrations | ||
| Run the following command to create and apply a migration: | ||
| npx prisma migrate dev --name init | ||
| npx prisma migrate dev | ||
|
|
||
| 3. Manage your data | ||
| View and edit your data locally by running this command: | ||
| View and edit your data locally by running this command: | ||
| npx prisma studio | ||
|
|
||
| ... or online in Console: | ||
| https://console.prisma.io/cliwxim5p005xqh0g3mvqpyak/cm6kw97t801ijzhvfwz4a0my3/cm6kw97ta01ikzhvf965vresv/studio | ||
| ...or online in Console: | ||
| https://console.prisma.io/$path | ||
|
|
||
| 4. Send queries from your app | ||
| To access your database from a JavaScript/TypeScript app, you need to use Prisma ORM. Go here for step-by-step instructions: https://pris.ly/ppg-init | ||
| If you already have an existing app with Prisma ORM, you can now run it and it will send queries against your newly created Prisma Postgres instance. | ||
|
|
||
| 5. Learn more | ||
| For more info, visit the Prisma Postgres docs: https://pris.ly/ppg-docs | ||
| ``` | ||
|
|
||
| </cmdResult> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,7 +189,6 @@ datasource db { | |
| // add-start | ||
| provider = "postgres" | ||
| // add-end | ||
| url = env("DATABASE_URL") | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.