Query Runner
The Query Runner is Mako’s database abstraction layer. It provides a single interface to execute queries across all supported databases, handling connection management, dialect differences, and result formatting.
Supported Databases
Section titled “Supported Databases”| Database | Driver | Connection Type |
|---|---|---|
| PostgreSQL | postgresql | Host/port or connection string |
| Cloud SQL (Postgres) | cloudsql-postgres | Instance connection name |
| BigQuery | bigquery | Project ID + service account |
| MongoDB | mongodb | Connection string |
| MySQL | mysql | Host/port |
| ClickHouse | clickhouse | Host/port |
| Redshift | redshift | Host/port (PostgreSQL wire protocol) |
| SQLite | sqlite | File path |
| Cloudflare D1 | cloudflare-d1 | Account ID + database ID |
Adding a Database Connection
Section titled “Adding a Database Connection”In the Mako UI:
- Click Databases in the sidebar
- Click Add Connection
- Select the database type
- Enter connection details
- Click Test Connection to verify
- Save
IP Whitelisting
Section titled “IP Whitelisting”If your database requires IP whitelisting, add Mako’s static outbound IP:
34.79.190.46MongoDB Atlas Specifics
Section titled “MongoDB Atlas Specifics”Atlas connection strings need the database name as a path segment, not a query parameter:
# What Atlas gives you:mongodb+srv://user:pass@cluster.mongodb.net/?appName=Cluster
# What Mako needs:mongodb+srv://user:pass@cluster.mongodb.net/DatabaseNameHow It Works
Section titled “How It Works”The Query Runner uses a driver registry pattern. Each database type has a driver that implements:
- Connection pooling — Connections are cached and reused
- Query execution — Takes SQL/MongoDB queries and returns structured results
- Schema inspection — Lists databases, tables, columns, and sample data
- Dialect handling — Identifier quoting, type casting, and syntax differences
The AI agent uses the Query Runner under the hood — when it calls sql_execute_query, the Query Runner resolves the correct driver, executes against the right database, and returns results.