It's a new project. However, Hubski has been using postgres for a few years, but it's currently an amalgam of Arc and Racket. I didn't write the db code, and am trying to start fresh. The Hubski racket connection looks like:
>Can you show what command you're running to check that you "can connect to the db from the Arc command line"?
Here's my test code that works in the command line, and the response. (I named my db "root" atm and will change that and the user once I get it working. I'm running the app as root.):
arc> (tostring (pipe-to (system "psql -U root -d root") (prn "SELECT * FROM items WHERE name = 'marble';")) )
" item_id | name | type | description | created |
location \n---------+--------+------+-------------------------------------+-- ------------
--------------+----------------------------------------------------\n 1 | marble | tool | A small, translucent orange bauble. | 2022-02-23
17:59:45.480545 | 0101000020E610000012C2A38D239A5EC040683D7C99E44240\n(1 row)\n\n"
arc>
But when I have that same code in the app, it times out. I tried to add (prn "\\q") at the end, but same result. Works in command line but hangs up in the app.
I even tried to specify the host and port:
(pipe-to (system "psql -U root -h 159.203.186.97 -p 5432 -d root") (prn "SELECT * FROM items WHERE name = 'marble';"))
With this in my pg_hba.conf
host all root 159.203.186.97:5432 trust
And the same result; returns in command, app times out. Checked the port:
BTW, I am using the domain xyrth.com with a nginx reverse proxy. I just had the thought it may be my nginx configuration. It probably needs to listen explicity on 5432? Here's my current sites-enabled: