DB seed in the Remix Blues Stack

Hi, I am using Blues Stack which works great on my local. I am able to successfully deploy to the staging environment as well but I need to have some data to be able to test it properly.

I am trying to run Prisma seed using local proxy but failing to do so. I tried to use local proxy using the command flyctl proxy 5432 -a guerdon-v2-staging-db which runs successfully but it seems that its not working. When I try to test it via psql postgres://postgres:postgres@localhost:5432 it works but I see the data on my local machine and when I connect it via psql postgres://postgres:<password>@localhost:5432 it fails with the following command.

psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

This means it’s very likely the password is wrong.

Another possible reason is that you could already have a postgres running on port 5432, try changing the proxy port to another and connect to it.

Thanks for pointing that out, since Blues Stack needs to run a Docker, I stopped the docker and now I am able to connect to the Db using psql but I am not able to run any prisma specific command. For example I want to see the data but its hangs without any output.

npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database <name >, schema "public" at "localhost:5432"

That might sound like it’s using credentials from your .env, maybe this has credentials that aren’t prod’s?

Also, I quickly read about db push, sounds like a command that might harm your prod database without migration

I am currently using staging environment and .env contains the credentials for the same. I am not what can be better alternative to populate the DB with seed values.

On a re-read, doesnt this output mean your prisma db was loaded?

No, it just loaded schema from local schema definition. I am still stuck and cannot make any progress so far. So, I see the same issue with pgadmin as well, while trying to add a new server the pgadmin hangs trying to connect. I am not sure what is going on as I am able to connect via psql from command line.

I installed Postico and it did seem to work as it shows all the tables but when I select a table to see it contents it also hangs indefinitetly.