Workspace
Databases
PostgreSQL, SQLite, and MongoDB in the same project. Each connection picks an engine; the workspace changes with it.
A Based project can hold any mix of the three engines. The engine is a field
on the connection file (engine = "postgres",
"sqlite", or "mongodb"), not a separate app mode.
Postgres is the deepest daily driver; SQLite and MongoDB share the same
catalog, tabs, and saved-query model.
At a glance
| PostgreSQL | SQLite | MongoDB | |
|---|---|---|---|
| Query language | SQL | SQL (multi-statement scripts) | Aggregation pipeline (JSON) |
| Catalog | Schemas → tables, views, materialized views | Tables, views, triggers | Collections |
| Data viewer | Paginated SELECT * | Paginated SELECT * | find(), first 200 documents |
| Structure | Columns, indexes, constraints, stats | Columns, indexes, constraints, DDL | Collection stats / inferred schema |
| 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 |
| Inline row editing | Not shipped | Not shipped | Document edit UI not wired |
PostgreSQL
Primary SQL engine via sqlx. A project connection needs
host, 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) to
Disable. 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 500 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 default
database.
- 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.
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 — see
Connections and
Editor.