PostgreSQL
This is a step by step guide to integrate PostgreSQL and Querio.
1) Create a dedicated PostgreSQL user
What: A non-human account used only by Querio, with least-privilege access.
How (run as a superuser or a role with CREATEROLE):
Execute the following SQL against the DB
-- Replace 'querio_user' and 'STRONG_PASSWORD' as needed
CREATE USER querio_user WITH PASSWORD 'STRONG_PASSWORD';Tip: Use a long, random password (at least 16 characters) — a password manager can generate one.
2) Grant read-only access to the required database/schema
What: Limit Querio’s access to only the data it needs.
How (example for my_database and public schema):
Execute the following SQL against the DB
-- Database access
GRANT CONNECT ON DATABASE my_database TO querio_user;
-- Schema access
GRANT USAGE ON SCHEMA public TO querio_user;
-- Table access
GRANT SELECT ON ALL TABLES IN SCHEMA public TO querio_user;
-- Future-proof: auto-grant SELECT on new tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO querio_user;Adjust the schema name if your data is not in public. Repeat grants for each schema Querio needs to query.
3) Collect and share the connection string
What: This is the standard PostgreSQL URI format Querio will use to connect.
postgresql://<username>:<password>@<host>:<port>/<database>How to find each value:
- username: querio_user (or whatever you created)
- password: The one you set in CREATE USER
- host: Your PostgreSQL server’s hostname or IP address
- port: Usually 5432 unless configured otherwise
- database: The database Querio should query