Databases
Serverless SQLite for every project
Every project can attach SQLite databases that persist across deployments. Migrations in your repository are applied automatically on deploy, and the dashboard gives you a SQL editor, table browser, and query performance insights.
Database Explorer
Total Queries
Last 24 hours
Avg Exec Time
P95: 12ms
Rows Read
Last 24 hours
Rows Written
Last 24 hours
Top Queries by Execution Time
Most expensive queries in the last 24 hours
| Query | Calls | Avg Time | Rows Read |
|---|---|---|---|
| SELECT * FROM users WHERE active = ? | 12,453 | 2.3ms | 45,231 |
| SELECT * FROM orders WHERE user_id = ? | 8,721 | 4.1ms | 89,234 |
| INSERT INTO sessions (user_id, token) VALUES (?, ?) | 5,432 | 1.2ms | 0 |
| SELECT p.*, c.name FROM products p JOIN categories c... | 3,211 | 8.7ms | 156,432 |
| UPDATE users SET last_login = ? WHERE id = ? | 2,145 | 1.8ms | 2,145 |
Key Features
Migrations From Git
SQL migrations in your repository run in order on every deploy, including Drizzle-generated folders.
SQL Editor
Run queries against production or a preview database directly in the dashboard.
Table Browser
Browse tables, inspect schemas, and page through rows without writing a query.
Query Insights
See your slowest and most frequent queries so you know what to index.
D1-Compatible API
prepare, bind, batch, and exec, so existing D1 code and Drizzle setups port over unchanged.
AI Query Generation
Describe the data you need and let the dashboard draft the SQL for you.
Database Binding
Declare a database in ploy.yaml and query it through env with a D1-compatible API.
export default {
async fetch(request, env) {
const { results } = await env.DB
.prepare("SELECT * FROM users")
.all();
return Response.json({ users: results });
},
} satisfies Ploy;