🏠 back to Observable

PostgreSQL "connection terminated" - quite frustrated :/

Thanks in advance for taking a look - I know this should be a basic thing to do but I can’t get Observable to connect to my local PostgreSQL database.

I installed the observable-database-proxy library, and created a local connection to my database to my localhost on port 5432 (the one I normally use on jupyter notebook & others, where it works well).

When trying to connect, I’m using the url “postgresql://username@127.0.0.1/{database}”.
I then launch on the terminal “observable-database-proxy start {database}”.
However when trying to run a query against the database on an Observable notebook, I always see an “Error: Connection terminated unexpectedly” message.

This is the log I can see in terminal:

Error: Connection terminated unexpectedly
    at Connection.con.once (/usr/local/lib/node_modules/@observablehq/database-proxy/node_modules/pg/lib/client.js:255:9)
    at Object.onceWrapper (events.js:277:13)
    at Connection.emit (events.js:189:13)
    at Connection.EventEmitter.emit (domain.js:441:20)
    at Socket.<anonymous> (/usr/local/lib/node_modules/@observablehq/database-proxy/node_modules/pg/lib/connection.js:139:10)
    at Socket.emit (events.js:194:15)
    at Socket.EventEmitter.emit (domain.js:441:20)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Any help will be hugely welcome, I’ve been blocked on this for over an hour, trying different combinations of ports, username… yet nothing. :sweat:

In case it helps, this is the message that I see when trying to test the connection in Observable’s Settings:Message