Connecting PostgreSQL
Greppilot allows you to connect to your PostgreSQL database to enable AI-powered analytics, data exploration, and automated reporting.
Configuration
To connect Greppilot to your PostgreSQL database:
- Navigate to the Integrations section in your Greppilot dashboard.
- Select PostgreSQL from the list of available integrations.
- Provide your database Connection String.
Greppilot stores your connection string securely using industry-standard encryption. All queries executed against your database by Greppilot are read-only (SELECT statements only).
Connection String Format
The connection string must be a valid URL. Greppilot supports the postgres:// and postgresql:// protocols.
Example Connection String:
postgres://user:password@host:5432/database
| Parameter | Description |
|---|---|
user | The database username. |
password | The database password. |
host | The database server hostname or IP address. |
port | The database server port (default is 5432 for PostgreSQL). |
database | The name of the database to connect to. |
Connection Validation
Greppilot performs validation checks on your connection string during configuration:
- URL Format: Ensures the string is a valid URL (e.g.,
postgres://user:pass@host/db). - Protocol: Only
postgresandpostgresqlprotocols are supported for PostgreSQL connections. Other supported database types includemysql,clickhouse, andmssql. - Hostname: Blocks connections to reserved IP ranges or cloud metadata endpoints (e.g.,
169.254.x.xor hostnames containingmetadata).
Available Actions
Once connected, Greppilot's AI agent can perform the following actions on your PostgreSQL database:
Query Your Data
Once connected, simply ask the agent questions in plain English. The agent automatically uses your database schema to construct accurate SQL queries.
Example prompts:
- "Show me the total revenue for the last month from the orders table."
- "What are the top 10 customers by lifetime value?"
- "Compare monthly signups this year vs last year."
View Your Schema
The agent automatically introspects your database schema when you connect. You can ask it what's available:
- "What tables are in my database?"
- "What columns does the orders table have?"
Refresh Schema
If your database schema changes (new tables, modified columns), ask the agent to update its understanding:
- "Refresh the schema for my database."
The agent remembers your schema across conversations, so you only need to refresh when your database structure changes.