Reputation: 11804
I have followed https://www.prisma.io/docs/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002 and gotten it to work. I can see the following:
docker ps
tells me that two docker containers are being runnode index.js
each time shows a list of all users that have been created. hence, there is a database somewhere docker exec -it POSTGRE_CONTAINER_ID bash
, I get a command prompt.psql
or psql prisma
, i get psql: FATAL: role "root" does not exist
How do I see in which database/table is prisma saving my data in, and how do I connect to it?
Upvotes: 3
Views: 4129
Reputation: 656
you can type: psql postgresql://user:password@host:5432/postgresdb
user = username you have used in dockerfile
password = password you have used
host = your host URL postgresdb = your postgres db name from dockerfile
Upvotes: 0
Reputation: 10145
I am using odcker to open MySQL:
docker exec -it server_mysql_1 mysql -u root --host 127.0.0.1 --port 3306 --password=prisma
Of course, use your own settings!
Upvotes: 0
Reputation: 498
Prisma doesn't store data in the public schema by default. It stores it in an schema derived from your service name (default$default
is the default when no service and stage is provided in the endpoint).
You can do the follow steps to see the underlying data:
docker ps
docker exec -it <POSTGRES_CONTAINER_ID> psql -U prisma
\dn
to grab all schemas, and find the schema that your service is using(it is default$default
by default)SET search_path to <YOUR_SCHEMA_NAME_FROM_STEP_3>;
to change the default search path\dt
to list all tables. You can also run any SQL command now on that schema.Upvotes: 4