Quick Start
As Agent Tool
Schema Introspection
Query Examples
Query Result
Safety Features
Read-Only Mode (Default)
Table Restrictions
Parameterized Queries
All generated SQL uses parameterized queries to prevent SQL injection.Write Operations (Use with Caution)
Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection URL |
OPENAI_API_KEY | Yes | For NL to SQL translation |
Connection URL Format
Best Practices
Guidelines
Guidelines
- Always use read-only mode unless writes are necessary
- Whitelist tables to limit access
- Set row limits to prevent large result sets
- Review generated SQL before executing in production
- Use connection pooling for high-traffic applications
Related
Database
Database adapters
Agent Tools
Creating custom tools

