-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add example project using Prisma #188
base: main
Are you sure you want to change the base?
Conversation
The code has been scaffolded like this: npx try-prisma@latest --template javascript/script --install npm --name . --path . This commit adds the result unmodified.
### 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:270
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.
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