Thanks for your interest in RED (Roughly Enough Data), a fast, native database explorer in pure Rust on GPUI. This guide covers setup, the checks a change has to pass, and how to open a pull request.
RED prioritises speed, low memory, and good behaviour on large result sets over
feature-completeness. Changes are weighed against those values first. The
canonical coding guide is docs/conventions.md; read it
before your first change.
-
Rust ≥ 1.96 (the workspace
rust-version). Install via rustup. -
macOS: a full Xcode toolchain. GPUI compiles Metal shaders, which the Command Line Tools alone can't do. If
xcode-select -ppoints atCommandLineTools, set:export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer -
just(optional but recommended):brew install just. It wraps the common tasks; runjustto list them.
A fresh clone builds with no extra setup. Flint (the shared UI library) is a pinned git dependency, so Cargo fetches it for you:
cargo run -p red # or: just runEvery change must be green under format, lint, and tests before it's pushed:
just check # = fmt + lint + testor the raw commands:
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings # warnings are errors
cargo test --workspaceCI runs the same three checks on every pull request; a PR can't merge until they pass.
Flint is pinned by git rev in Cargo.toml so outside contributors
build without a sibling checkout. When you need to change a Flint component and
RED at the same time, check Flint out next to RED and point Cargo at your local
copy with a patch in the workspace Cargo.toml (do not commit this):
[patch."https://github.com/vojir-mikulas/flint"]
flint = { path = "../flint" }New shared components are built gallery-first in Flint with a generic,
domain-free API. Spike the usage in RED first so the API is right, then push it
down into Flint (just gallery runs Flint's component gallery).
RED and Flint both pin gpui to the same Zed revision. Cargo only unifies two
git deps when their URL and rev match, so a mismatch silently pulls in a second,
incompatible gpui. Bumping the rev (or the Flint pin) is a coordinated change
across both repos, not something to do casually in a feature PR.
red: the GPUI application binary; renders all UI on the main thread.red-core: shared domain types (Value,QueryResult,RedError, …) with no UI or runtime knowledge.red-driver: theDatabaseDrivertrait and engine implementations (SQLite, PostgreSQL, MySQL). The only seam to a database engine.red-service: the Tokio backend thread and theCommand/Eventbridge.
The UI never blocks on the backend: it sends Commands and observes Events
over channels. The UI speaks red-core types and Commands/Events, never
driver internals.
These come up most in review (full list in docs/conventions.md):
- Comments explain why, not what, and stay free of milestone/ticket references. Keep planning context out of the code.
thiserrorin libraries,anyhowat the app edge. Usetracingfor diagnostics; noprintln!/eprintln!in shipped paths.- Build the UI with Flint and semantic theme tokens (
cx.theme().bg_app), not raw colors. - Stream large results. Never materialize a whole result set by default;
results flow through a windowed cursor behind
DatabaseDriver. - Safe by default. Confirm destructive queries; honour read-only connections and query timeouts.
- Branch off
main. - Keep the change focused; match the style of the code around it.
- Run
just check; it must be green. - Write a clear PR description: what changed and why. Conventional-commit-style
subjects (
feat:,fix:,refactor:,chore:) are appreciated.
By contributing, you agree your contributions are licensed under
GPL-3.0-or-later, the project's license (see LICENSE and
NOTICE).