A Postgres database wired into n8n
Swap the Data Table node for a Postgres node. The connection already exists in your n8n, with its own credential, and it stays there. You can let the workflow build the query from $json.params, or write the statement in Loopthink as a fixed value, a parameter the model never sees and cannot replace:
SELECT id, guest, total FROM reservations WHERE country = :country ORDER BY booked_at DESC LIMIT 50
The :country is filled from what the model passed, escaped by declared type before it leaves us, so the statement arrives ready to run. The database password is never anywhere near us.







