Prerequisites
- A PostgreSQL database that NOFire AI can reach.
- A read-only role, created in Step 1.
- The connection string, or the host, database, user, and password.
Step 1: Create a read-only role in PostgreSQL
Create a Read-Only Role
Create a Read-Only Role
Connect to your database. Change the database and schema names to match your setup. Then create a role for NOFire:
Use a read-only role. NOFire runs every transaction with
default_transaction_read_only=on, and a dedicated role makes that guarantee explicit for auditors.Step 2: Add PostgreSQL connection to NOFire AI
- Open Connections and click Connect on PostgreSQL.
- Enter a Name for the connection (for example,
production-app-db). - Below Name, use the DSN / Host / Database buttons to switch modes. The form opens in DSN mode.
DSN
DSN
- Connection String: masked (for example,
postgresql://reader:[email protected]:5432/app?sslmode=require)
Host / Database
Host / Database
- Host: for example,
db.example.com - Port: defaults to
5432 - Database: for example,
app - User: for example,
readonly_user - Password: masked
- SSL Mode: defaults to
require. Options:disable(no TLS, local dev only),allow,prefer,require(encrypted, no cert check),verify-ca,verify-full(recommended for prod)
5000.
Click Connect. NOFire checks the credentials and creates the connection.
Test the connection
- Open Connections and make sure that the PostgreSQL connection shows Connected. A connection that shows Failing did not authenticate.
- Ask NOFire a question that needs database context, for example “which tables have the most sequential scans?”. An answer that names your tables confirms the connection works end to end.
Troubleshooting
The connection fails with an SSL error
The connection fails with an SSL error
The SSL mode on the connection is stricter than the server supports.
verify-full needs a certificate the server can present and a matching host name.The connection saves but returns no activity
The connection saves but returns no activity
The role cannot read the
pg_stat_* views. Grant it pg_monitor.
