Introduction
Poge provides a Next.js API backend for PostgreSQL database operations. The API handles query execution, connection management, schema exploration, and statistics tracking.Base URL
All API endpoints are relative to your Poge deployment:Authentication
Poge uses client-side authentication with no server-side auth required. Database credentials are passed directly in API requests and used to establish connections via PostgreSQL connection pooling.Request Format
All POST endpoints accept JSON payloads with the following structure:SSL Mode Options
SSL connection mode. Options:
disable- No SSL (default)require- Require SSL with self-signed certificates allowedprefer- Try SSL first, fallback to non-SSL
Response Format
Success Response
Successful responses return JSON with appropriate status codes (200, 201):Error Response
Error responses include detailed error information:Common Error Codes
| Code | Description |
|---|---|
ECONNREFUSED | Database server is not reachable |
ENOTFOUND | Hostname cannot be resolved |
28P01 | Authentication failed (invalid credentials) |
3D000 | Database does not exist |
28000 | User lacks database permissions |
ECONNRESET | Connection reset (often SSL misconfiguration) |
Rate Limiting
No rate limiting is enforced. Connection pooling handles concurrent requests efficiently.Available Endpoints
Test Connection
Verify database credentials and connectivity
Query Execution
Execute SQL queries with transaction support
Schema Operations
Retrieve database schema tree structure
Table Operations
Fetch paginated table data with sorting
Statistics
Connection pool and query cache statistics
Connection Pooling
Poge uses PostgreSQL connection pooling to optimize performance. Each unique connection configuration (host, port, user, database) maintains a separate pool.Pool Configuration
- Max clients per pool: 10
- Idle timeout: 30 seconds
- Connection timeout: 5 seconds