W
Wasp•10mo ago
kvares

Accesing the database in pgAdmin

Wanted to ask can I acces the database of the open-saas template in pgAdmin? Currently the regular postgres account (name: postgres, password: postgres) is not working.
38 Replies
kvares
kvaresOP•10mo ago
So is there like a default config fill or smth like this or is the error on my part
martinsos
martinsos•10mo ago
Ok, so it depends on how you run your database. Wasp, and therefore open-saas, doesn't put any restrictinos on how you run your Postgres db. You can run it on your own, and then you just provide Wasp with the connection URL via .env.server . In that case, those same creds from that connection URL is what you will give to pgAdmin. If you instead used wasp db start to have Wasp run a Postgres dev database for you, you can see the URL connection being printed at the very start of wasp db start output -> and again, you can use that to connect to that postgres db via pgadmin.
Sam Jakshtis
Sam Jakshtis•6mo ago
@martinsos I know this is old, but I am struggling here. I used wasp db start and I have my file, but I get a psql: FATAL: password authentication failed for user "postgresWaspDevUser". I have exhausted everyway to solve it, but cant. Any ideas? Thank you
miho
miho•6mo ago
I've tested out connection with pgAdmin 4 on MacOS using the connection string provided by the wasp db start command. What is your setup? Maybe WSL 2 with Windows?
Sam Jakshtis
Sam Jakshtis•6mo ago
@miho Im MacOS (Sonoma) and I have an issue where it keeps saying psql: FATAL: password authentication failed for user "postgresWaspDevUser" and I have tried to change everything, just wondering why it wont connect and if you know of something I might be missing
miho
miho•6mo ago
You are using psql to connect to the DB? What do you write in the terminal to achieve that?
miho
miho•6mo ago
No description
Sam Jakshtis
Sam Jakshtis•6mo ago
I apologize, I wasnt clear when trying to connect to PGAdmin Page, I get FATAL ERROR. The wasp side works, but connecting to admin has not. @miho Any thoughts?
No description
No description
miho
miho•6mo ago
I've got the same thing as you 😄 1. Do you have another PostgreSQL db running locally? 2. Did you set the DATABASE_URL env var for your app in the .env.server file?
No description
MEE6
MEE6•6mo ago
Wohooo @miho, you just became a Waspeteer level 35!
Sam Jakshtis
Sam Jakshtis•6mo ago
@miho I did, added it below another variable, still same error currently. I downloaded PGAdmin as a super user, but cant imagine that would affect it would it?
No description
miho
miho•6mo ago
What about this question:
Do you have another PostgreSQL db running locally?
There is no need to add the DATABASE_URL env var if you are using the built in dev DB, let's remove it 🙂 I don't have it. Does your app still work after you remove it?
Sam Jakshtis
Sam Jakshtis•6mo ago
Yes works fine without it, hmm this is tricky. Again no other postgres running the only thing is I downloaded and created a super user, so I guess that could be the issue?
miho
miho•6mo ago
Hmmm does running wasp db studio work for you? That's a lightweight DB client with which we could test this theory out
Sam Jakshtis
Sam Jakshtis•6mo ago
Yup that works, brings me to prisma And able to view all data
miho
miho•6mo ago
Ok, it seems then the pgAdmin client is somehow at fault or you are maybe misconfiguring it. Could you maybe reinstall it? I used this site: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v8.9/macos/
martinsos
martinsos•6mo ago
Yeah I think this will come down to figuring out how to use pgAdmin in this case. Might be problem with the super user as you mentioned @Sam Jakshtis . Might be that we are just incorrectly using pgAdmin -> how experience are you with pgAdmin @Sam Jakshtis ? Btw there is this thing on Mac whre if you have something already running on 5432, for example native postgresql db, it will just hide the postgresql that wasp is running also on 5432. but you said that is not happening hm, and then also other stuff shouldn't work (like prisma studio), so I don't think this is it.
Sam Jakshtis
Sam Jakshtis•6mo ago
@martinsos Hmm Yea debugging has led me to super users permissions. Weirdly have not done a ton with Postgres, especially on my own, I will keep trying and if I solve it I will ceertainly share results in case anyone experiences same issue @martinsos Would you be willing to fork it on your end and seeing if its just my machine? I know this is a lot, just incredibly stuck right now or @miho sorry, I am just so lost and have done absultley everything to get pgadmin show the database that I created
MEE6
MEE6•6mo ago
Wohooo @Sam Jakshtis, you just became a Waspeteer level 3!
Juan
Juan•6mo ago
I run my own Postgresql db and provide Wasp the Database_URL. In order to access Postgresql via phAdmin I updated the authentication method from 'peer' to 'md5' in pg_hba.conf
miho
miho•6mo ago
@Juan thanks for the info! @Sam Jakshtis DM me and we can maybe jump on a call
Sam Jakshtis
Sam Jakshtis•6mo ago
@miho @Juan @martinsos You would not believe this, I fixed it. I was using github's codespaces and wasnt even considering that as a possibility. I just cloned on local and it worked. Doesnt affect you guys, but thought I would let everyone know in case others/you run into the issue ever. Thanks again for all your help
miho
miho•6mo ago
So you were trying to connect from your computer to a DB on GitHub codespaces? 😃
Sam Jakshtis
Sam Jakshtis•6mo ago
No, I was trying to connect to a local Postgres DB from Codespaces. I unfortunately I dont have the smarts to know the exact reason, but there are some other things that codespaces has proved to be a little finicky with. Once I went fully local, it was easy and worked as it should.
miho
miho•6mo ago
Nice, I'm glad to hear that 🙂 Yeah, usually networking proves to be the main hurdle and when everything is local, it usually just works 😄
Sam Jakshtis
Sam Jakshtis•6mo ago
Thanks again you guys are the best, looking forward to seeing everyone in a few min
martinsos
martinsos•6mo ago
Ah that explains it @Sam Jakshtis ! Right, I haven't used Codespaces much, but I can imagine that it adds an additional layer of complexity, especially the networking as @miho said. We haven't put much effort yet into making sure Wasp is a great experience to use in Codespaces, we might want to look into that more in the future. I am curious, how is it that you went with Codespaces? Just easier start?
Sam Jakshtis
Sam Jakshtis•6mo ago
@martinsos I have been trying it out and loving it (due to laziness) since it expedites the git process. In leiu of using git via cli, you just connect via vscode (I am sure there are other ides too) and it tracks all changes and you just have to commit and push seamlessly. I think its best for frontend work since it changes dynamically, but connections can be finicky. I had issues with the auth with it and of course now the db @martinsos Anyway I can send you a DM? I think I tried, but wanted to get in touch with you and @Vinny (@Wasp) if possible
Vinny (@Wasp)
Vinny (@Wasp)•6mo ago
what's up?
Sam Jakshtis
Sam Jakshtis•6mo ago
Hi @Vinny (@Wasp) I wanted to reach out to say what a great job you and the team did with the release the other day. I am somewhat new to wasp, but fell in love and I am building a saas product with wasp (realti.org). I am also going to grad school at MIT in the Fall and would love to help the team in anyway I can. I am nowhere near the developer that you (and the team) are/is, but if there is anything I can do to help, please let me know (writing articles, doing demos, be a campus rep = } ). Thanks again for a great product, love using it
Vinny (@Wasp)
Vinny (@Wasp)•6mo ago
Hey Sam. Thanks for the nice message. We have a "write for wasp" program. Did you get the link?
Vinny (@Wasp)
Vinny (@Wasp)•6mo ago
Realti.org looks great!
Sam Jakshtis
Sam Jakshtis•6mo ago
@Vinny (@Wasp) That looks great, is the process as simple as writing an article and sending it to team for approval?
Vinny (@Wasp)
Vinny (@Wasp)•6mo ago
This is what the usualy process looks like: 1. send an outline for approval, then 2. a draft, 3. if accepted, do some revisions, 4. publish
Sam Jakshtis
Sam Jakshtis•6mo ago
Perfect, I see the how to's and comparisons, but are there specifics within those categories
martinsos
martinsos•6mo ago
@Sam Jakshtis soudns good responded to DM!
Vinny (@Wasp)
Vinny (@Wasp)•6mo ago
It's usually best if you come to us with topics youre excited about that meet the criteria from there we usually try to find a compromise. That way it's something that's interesting to you, and not just a boring writing assignment from us. I accepted your DM request so we can continue the conversation there if you're insterested
Want results from more Discord servers?
Add your server