-
Notifications
You must be signed in to change notification settings - Fork 9
Add example project using Prisma #188
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
base: main
Are you sure you want to change the base?
Conversation
| ### Create the database | ||
|
|
||
| Run the following command to submit the SQL DDL to the database. This will create | ||
| database tables for the `User` and `Post` entities that are defined in | ||
| [`prisma/schema.prisma`](./prisma/schema.prisma). | ||
| ```shell | ||
| npx prisma migrate dev --name init | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prisma wants to run a CREATE SCHEMA command when using a connection string like postgresql://crate@localhost:5432/mydb?schema=public.
$ npx prisma migrate dev --name init
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "mydb", schema "public" at "localhost:5432"
Error: Schema engine error:
ERROR: line 1:8: no viable alternative at input 'CREATE SCHEMA'There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using postgresql://crate@localhost:5432/?schema=doc as database connection string, it trips on the CREATE DATABASE statement.
Error: P3014
Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at https://pris.ly/d/migrate-shadow
Original error:
ERROR: line 1:8: no viable alternative at input 'CREATE DATABASE'
0: schema_core::state::DevDiagnostic
at schema-engine/core/src/state.rs:270There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this mechanism can be used to make CrateDB work, so that Prisma is no longer failing right away on migrate dev?
In some cases it might make sense (e.g. when creating and dropping databases is not allowed on cloud-hosted databases) to manually define the connection string and name of the database that should be used as the shadow database for
migrate dev.
This comment was marked as duplicate.
This comment was marked as duplicate.
The code has been scaffolded like this: npx try-prisma@latest --template javascript/script --install npm --name . --path . This commit adds the result unmodified.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Support for |
|
Thanks. We may need to look into the |
About
Verify Prisma works well with CrateDB.
Details
The code has been scaffolded like this:
Thoughts
Two pointers shared by @BaurzhanSakhariev. Thanks!
/cc @proddata, @hammerhead, @hlcianfagna, @simonprickett, @kneth