This API provides dynamic access to all tables in your read-only database with comprehensive filtering capabilities.
GET /tables
Returns a list of all accessible tables in the database.
Response:
{
"tables": ["users", "products", "orders", "categories"]
}GET /tables/{table}/schema
Returns the schema information for a specific table.
Response:
{
"table": "users",
"schema": [
{
"column_name": "id",
"data_type": "integer",
"is_nullable": "NO",
"column_default": "nextval('users_id_seq'::regclass)"
},
{
"column_name": "email",
"data_type": "character varying",
"is_nullable": "NO",
"column_default": null
}
]
}GET /{table}/{columns}
Dynamically query any table with specified columns and filters.
Parameters:
{table}: The table name{columns}: Comma-separated column names or*for all columns
Query Parameters:
Filters use the format: {column}_{operator}={value}
Supported Operators:
eq- Equal tone- Not equal togt- Greater thangte- Greater than or equal tolt- Less thanlte- Less than or equal tolike- Case-insensitive pattern matchingin- Value in list (comma-separated)not_in- Value not in list (comma-separated)is_null- Is null (no value required)is_not_null- Is not null (no value required)
limit- Number of records to returnoffset- Number of records to skip
orderBy- Column to sort byorderDirection-ASCorDESC(default: ASC)
GET /users/*
GET /users/id,email,name
GET /users/id,email?email_eq=john@example.com
GET /products/id,name,price?price_gte=10&price_lt=100
GET /users/id,name,email?name_like=john
GET /orders/id,user_id,status,total?status_eq=completed&total_gte=50&user_id_in=1,2,3
GET /products/id,name,price?limit=20&offset=40&orderBy=price&orderDirection=DESC
GET /orders/id,user_id,status,total,created_at?status_in=pending,completed&total_gte=25&limit=50&offset=0&orderBy=created_at&orderDirection=DESC
GET /users/id,name,phone?phone_is_null=true
All data queries return:
{
"data": [...], // Array of matching records
"total": 150, // Total count of matching records
"page": 3, // Current page (if pagination used)
"pageSize": 20 // Page size (if pagination used)
}- Table Whitelist: Only tables that exist in the database are accessible
- Column Blacklist: Sensitive columns (password, secret, token, private_key) are blocked
- SQL Injection Protection: All queries use parameterized statements
- Read-Only: Only SELECT operations are allowed
400 Bad Request- Invalid query parameters or operators403 Forbidden- Access to table or column is denied404 Not Found- Table does not exist
- Column names in filters should match the exact column names in the database
- String comparisons are case-sensitive except for
likeoperator which is case-insensitive - For
inandnot_inoperators, separate multiple values with commas - Date/time filtering works with standard formats (ISO 8601 recommended)