Workspace
Databases
PostgreSQL, SQLite, MongoDB, and Redis in the same project. Each connection picks an engine; the workspace changes with it.
A Based project can hold any mix of the four engines. The engine is a field on the connection file (engine = "postgres","sqlite", "mongodb", or "redis"), not a separate app mode. Postgres is the deepest daily driver; SQLite, MongoDB, and Redis share the same catalog, tabs, and saved-query model.
At a glance
| PostgreSQL | SQLite | MongoDB | Redis | |
|---|---|---|---|---|
| Query language | SQL | SQL (multi-statement scripts) | Aggregation pipeline (JSON) | Raw commands (console) |
| Catalog | Schemas → tables, views, materialized views | Tables, views, triggers | Collections | Keys (first 2000, searchable) |
| Data viewer | Paginated SELECT * | Paginated SELECT * | find(), first 200 documents | Per-key view: string, hash, list, set, zset |
| Structure | Columns, indexes, constraints, stats | Columns, indexes, constraints, DDL | Collection stats / inferred schema | Type, TTL, length, memory |
| Explain | EXPLAIN (FORMAT JSON) | EXPLAIN QUERY PLAN | — | — |
| Autocomplete | Not yet | Tables, columns, keywords, functions | — | — |
| Read-only mode | Not in the connection file | read_only = true or a readonly tag | Not in the connection file | Not in the connection file |
| Inline row editing | Not shipped | Not shipped | Document edit UI not wired | Edit strings, add/remove entries, set TTL, delete keys |
PostgreSQL
Primary SQL engine via sqlx. A project connection needshost, database, and username.port defaults to 5432. Password should be{ env = "VAR" }, not a literal in git.
ssl on a connection file is a boolean: true maps to SSL mode Require, false (the default) toDisable. The New Connection wizard exposes the full set: Prefer, Require, Disable, Verify CA, Verify Full.
- Ad-hoc SQL editor and saved
[sql]queries. - Data viewer with page size from Settings (default 100 rows).
- Structure inspector for tables and views.
- Explain pane on the query editor.
- Test-before-connect in the wizard (latency + server version).
SQLite
File-backed. file is a path relative to the repo root (or absolute). Connection-time PRAGMAs live in an optional[pragma] table and are applied when the pool opens.
| Key | Default | Notes |
|---|---|---|
journal_mode | wal | Skipped when the connection is read-only (would mutate storage). |
synchronous | normal | Also skipped in read-only mode. |
foreign_keys | true | Still applied when read-only. |
Set read_only = true (preferred) or a readonly tag to open with mode=ro: no writes, and no empty database created if the file is missing. The connection dashboard also shows a live PRAGMA snapshot.
SQLite is the only engine with SQL autocomplete today. Multi-statement scripts run as a batch; the last result is shown. Query timeout from Settings is enforced on SQLite runs.
MongoDB
Native driver. The connection file needs a url (literal URI or{ env = "MONGO_URL" }) and an optional defaultdatabase.
- Catalog lists collections.
- Pipeline builder: JSON array of stages, run against a collection.
- Saved queries use
[aggregate]withpipelineand usuallycollection. - Document viewer: flattened
find(), capped at 200 documents. - Change-stream sampler opens on connect (needs a replica set; samples up to 64 events).
Introspection pipelines whose first stage is database-scoped (for example$listCollections) may omit collection; Based supplies a harmless default handle. Data pipelines that read documents must set collection.
Redis
Native async driver. The connection file needs a url(redis://[:password@]host:6379[/db], or rediss://for TLS), usually as { env = "REDIS_URL" }.
- Catalog lists keys via
SCAN(neverKEYS), capped at 2000. - Key viewer shows type, TTL, length, and memory. Edit string values, add or remove hash/list/set/zset entries (first 500 shown), set or clear a TTL, and delete a key.
- Console runs raw commands with redis-cli style output.
FLUSHALL,FLUSHDB,DEBUG,SHUTDOWN, andKEYS *need a second Enter. - Not yet: streams, SSH tunnels, Cluster/Sentinel, saved queries.
What is not engine-specific
Saved queries, history, the command palette, export to CSV/XLSX, and the table grid chrome are shared. A query’s [target] decides which connection (and therefore which engine) it may run against — seeConnections andEditor.