Where can I find documentation for this :point_up:
# orm-help
a
Where can I find documentation for this ☝️
1
j
What does your connection string look like? The
undefined
is weird there.
Is there a "path" in the URL after the hostname and port?
n
Yeah, I’ve seen similar errors on Postgres when the DB name isn’t specified in the connection string. (Our error messages are not very helpful though.)
a
DATABASE_URL="<postgresql://root@localhost:26257?sslmode=enabled>"
n
Ah yes, try to include a DB name like so:
DATABASE_URL="<postgresql://root@localhost:26257/mydb?sslmode=enabled>"
a
We are getting closer!
The provided database string is invalid. invalid port number in database URL. Please refer to the documentation in <https://www.prisma.io/docs/reference/database-reference/connection-urls> for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
I'll check the port i set up
Copy code
ps -ef | grep cockroach | grep -v grep
  501 66649     1   0 11:56AM ttys002   64:05.31 cockroach start --certs-dir=certs --store=node1 --listen-addr=localhost:26257 --http-addr=localhost:8080 --join=localhost:26257,localhost:26258,localhost:26259
  501 66711     1   0 11:57AM ttys002   56:34.34 cockroach start --certs-dir=certs --store=node2 --listen-addr=localhost:26258 --http-addr=localhost:8081 --join=localhost:26257,localhost:26258,localhost:26259
  501 66757     1   0 11:57AM ttys002   54:11.66 cockroach start --certs-dir=certs --store=node3 --listen-addr=localhost:26259 --http-addr=localhost:8082 --join=localhost:26257,localhost:26258,localhost:26259
getting closer!
db error: ERROR: permission denied to create database
DATABASE_URL="<postgresql://secret:supersecret@localhost:26257/defaultdb?sslmode=public>"
i guess the db name is
defaultdb
, so that's good. but time to follow the docs because of this error.
Copy code
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>
needed to alter the user role with permissions to
CREATEDB
. We are good for now
Ugggh... spoke too soon
Copy code
The following migration(s) have been created and applied from new schema changes:

migrations/
  └─ 20220629115129_init/
    └─ migration.sql

Your database is now in sync with your schema.

Running generate... (Use --skip-generate to skip the generators)
Error: Get DMMF: Schema parsing - Error while interacting with query-engine-node-api library
Error code: P1012
error: Datasource provider not known: "cockroachdb".
  -->  schema.prisma:6
   | 
 5 | datasource db {
 6 |   provider = "cockroachdb"
   | 

Validation Error Count: 1
solved.
@prisma/client
was not
4.0.0
👍 2
j
What a journey 😄
Good you figured it out in the end. We def could improve the connection string stuff a bit - that assumes to much knowledge and that the connection string is in a certain format.