01What it does
A complete set of database development tools in a fast native UI. The highlights:
Grid editing
Double-click a cell, add, duplicate or delete rows. Changes are tinted until you Preview the generated SQL, then Apply or Discard. Concurrent changes from other sessions are detected and named.
SQL editor for big scripts
Only visible lines are laid out: a 10 MB file scrolls and takes typing in well under a frame. Statement coloring, autocomplete, find/replace, multi-caret editing, formatting (⌥⌘L) and a command palette (⌘⇧P) over commands, snippets and history.
Profiles & commit modes
Each connection gets a Development, Test or Production profile — with its color, commit mode (Auto, Manual, Smart), a read-only flag and confirmation rules for writes and destructive statements.
Object editors
Tables, views, indexes, sequences, functions, triggers, schemas and databases open in tabs with sub-tabs for structure, definition, dependencies and sample data.
Transfer tools
Export queries to CSV/JSON, import files back, and copy between connections — including between two different database engines, row by row.
NoSQL, first class
MongoDB and Elasticsearch get document views with expandable JSON trees; Redis gets a key-value browser. A MongoDB shell subset covers the everyday commands.
02Supported databases
Bundled drivers ship in the app; every other driver downloads from the sqlr release in the Driver Manager, or installs from a local driver file.
| Database | Type | How it ships | Notes |
|---|---|---|---|
| PostgreSQL | Relational | bundled | Full driver: catalog, queries, grid editing, object editors. |
| MySQL / MariaDB | Relational | bundled | Full driver with dialect-aware queries and metadata. |
| SQL Server | Relational | bundled | Native TDS driver over rustls; SQL authentication and SSH tunnels. |
| Oracle | Relational | bundled | Pure-Rust oracle-rs; no OCI or Instant Client. |
| SQLite | Relational | bundled | File-per-database, no server required; backups and traces. |
| DuckDB | Relational | download | Sidecar embedding the DuckDB engine; local files and in-memory databases, no Java. |
| Snowflake | Relational | bundled | HTTPS SQL API with OAuth, PAT or JWT tokens; independent auto-commit requests. |
| MongoDB | Document | bundled | Collections, document viewer, shell-subset commands. |
| Elasticsearch | Search / document | bundled | Indices, documents, query DSL. |
| Redis | Key-value | bundled | KV browser with type-aware values. |
| SAP HANA | Relational | download | Sidecar built on hdbconnect_async, downloaded in the Driver Manager. |
| Any JDBC database | Relational | download | Java 17+ bridge, downloaded in the Driver Manager; pick your database's JDBC jar. |
03Performance budgets
These numbers are hard requirements enforced in CI — “not aspirations.” They are what keep sqlr from becoming Electron or a JVM app.
| Budget | Target | Why it matters |
|---|---|---|
| Cold start | < 1 s | The app must feel instant, like a terminal tool. |
| Idle memory | < 150 MB | No retained heaps; columns live only as needed. |
| Grid with 1M+ rows | 60 fps | Editing and scrolling stay fluid on big result sets. |
| Autocomplete / open table | < 50 ms | Catalog lookups must not lag behind typing. |
| Distributed binary | < 75 MB | A lightweight client you can carry anywhere. |
04Architecture
A small set of crates with strict boundaries. The UI thread never does I/O; all database work runs on the tokio runtime off the main thread.
| Crate | Role |
|---|---|
| sqlr-core | Domain types, columnar chunks, driver traits. Depends on nothing internal. |
| sqlr-driver-* | One driver per database (tokio-postgres, …). |
| sqlr-engine | Tokio runtime off the UI thread: sessions, explorer/catalog cache, results, history, installed sidecar drivers. |
| sqlr-sidecar | Sidecar protocol, SidecarDriver client, the serve loop. |
| sqlr-registry | Driver-file installs, versions and review, no UI. |
| sqlr-driver-sdk | Write a driver as a sidecar: re-exports the API and run. |
| sqlr-driver-tests | Conformance suite for drivers (dev-dependency only). |
| sqlr-store | Connections TOML, encrypted credential vault, settings. |
| sqlr-ui | egui widgets: grid, tree, forms, docked panels. |
- Security: no OpenSSL (rustls only); secrets live in an encrypted vault protected by the OS keychain and arrive at connect time.
- Threads: the UI thread never does I/O; every engine call is async on tokio.
- Caching: catalog explorer and autocomplete share one in-memory cache with bounded size.
// the whole app is: native Rust + egui + tokio // and deliberately not: no webview · no Electron · no JVM
05Adding a database: sidecars
A database sqlr doesn’t ship with becomes a sidecar driver: a separate executable that sqlr starts and talks to over stdio. Frame protocol v1.0.0 — each message is one length-prefixed frame:
| bytes | field |
|---|---|
| 4 | length — big-endian u32, size of everything after it (9 + payload) |
| 1 | type |
| 8 | request id — big-endian u64 |
| … | payload (MessagePack for control frames) |
Frames are capped at 64 MiB; a driver can be written in Rust with sqlr-driver-sdk — or in any language that can read and write the frames.
# scaffold a driver from the template
cargo generate --path templates/sqlr-driver-template --name my-driver
cd my-driver
cargo test
06Build & run
Requires Rust 1.98+ (workspace edition 2024). The default cargo commands act on the app; sidecar drivers are extra binaries.
# run the app cargo run # release build cargo build --release # test the workspace + driver conformance cargo test # exercise the HANA/JDBC sidecars cargo test -p sqlr-driver-hana
07Documentation
A step-by-step guide to using sqlr, from the first connection to backups and custom drivers.