Lua/pgmoon connection issues with Neon PostgreSQL endpoint ID configuration
Description:
I'm trying to connect to a Neon PostgreSQL database from a Lua application using pgmoon. Im:
* Attempting to establish a connection to Neon PostgreSQL from Lua using pgmoon library
* Running on Replit with PostgreSQL 15
The reason why is because I need to store user data and achievements in a PostgreSQL database
Here's my current connection code:
Error message:
What I've tried:
* Adding endpoint_id parameter
* Adding options parameter with encoded endpoint
* Using database_url with endpoint options
* Setting sslmode to require
* Specifying the endpoint ID in the password field
Extra information:
* My phone is constantly on do not disturb, so if you have an answer, ping me
* My timezone is Cst and I am available until 10 p.m.
10 Replies
extended-salmon•11mo ago
cc @Conrad Ludgate
conscious-sapphire•11mo ago
Hi. Sorry you're experiencing issues. Setting the endpoint_id in the options or in the password field should work, so this is very perplexing
Just to confirm, did you set
extended-salmonOP•11mo ago
Yes, I did.
Also this just gives me "connection refused"
Also all the environmental variables are set
extended-salmon•11mo ago
I don't you would set database_url in that snippet since you broke it apart ^. I'm not familiar with pgmoon. Do you need host and database table entries?
extended-salmonOP•11mo ago
i based it off of the github page in example
extended-salmonOP•11mo ago
GitHub
GitHub - leafo/pgmoon: A pure Lua Postgres driver for use in OpenRe...
A pure Lua Postgres driver for use in OpenResty & more - leafo/pgmoon
extended-salmonOP•11mo ago
I kind of just tried everything but that's where I left off. I don't think I need the database_url in there either.
I got it to work:
It turns out I had to put it in that specific order lol
conscious-sapphire•11mo ago
Oh, that's weird. Thanks for the update
I'll try and contribute a patch to pgmoon so the "password hack" isn't necessary next week
extended-salmonOP•11mo ago
Ok
Now I just have to go based off of the database table and update my code to handle it (it would be so much easier if I remembered the SQL code I made to make the database)😭
extended-salmon•11mo ago
pg_dump