- Keep this file concise. For each line, ask: would removing it cause mistakes? If not, cut it.
- Write commands and rules, not prose. Be imperative.
- Don't repeat what's in Cargo.toml, CI configs, or code comments.
- Update this file like code — review changes in PRs.
Lakekeeper — open-source Apache Iceberg REST catalog, written in Rust.
Repository: https://github.com/lakekeeper/lakekeeper
Uses just as task runner. See justfile for all available recipes.
Key commands:
- Build:
cargo build - Test all:
just test(includes doc tests) - Unit tests only:
just unit-test - Test one:
cargo test -p <crate> <test_name> - Lint:
just check(runs clippy with multiple feature combinations, format check, cargo-sort) - Format:
just fix-format(requirescargo +nightly fmtandcargo sort) - Auto-fix:
just fix
Clippy runs with multiple feature flag combinations — don't just run cargo clippy --all-features. Use just check-clippy.
| Crate | Path | Purpose |
|---|---|---|
| lakekeeper | crates/lakekeeper | Core catalog logic |
| lakekeeper-bin | crates/lakekeeper-bin | Server binary |
| lakekeeper-io | crates/io | Storage I/O (S3, GCS, Azure, etc.) |
| iceberg-ext | crates/iceberg-ext | Iceberg format extensions |
| lakekeeper-authz-openfga | crates/authz-openfga | OpenFGA authorization |
| catalog-error-macros | crates/catalog-error-macros | Error derive macros |
- OpenFGA model:
authz/openfga/— validate withjust test-openfga, update JSON withjust update-openfga - OPA policies:
authz/opa-bridge/— check withjust check-opa(requiresopaandregalCLIs)
- Follow existing patterns in adjacent files.
- Use
thiserrorfor error types,tracingfor logging. - Use
typed-builderfor struct construction. - Use workspace dependencies (
{ workspace = true }) — don't add versions directly. - All crate versions use
version.workspace = true. - Minimize new dependencies — justify additions.
- Before adding new code, check if existing crates already solve the problem. Reuse over reinvention.
- Challenge duplication — if similar logic exists elsewhere, refactor to share it.
- New features should extend existing traits/interfaces where possible rather than introducing parallel abstractions.
- Never skip or disable tests.
- Do not modify generated or vendored files.
- Release versioning is managed by release-please (
release-please/). - Never acquire a nested database connection. If a transaction is active, all subsequent queries must use that transaction — do not check out another connection from the read or write pool. Nested connections cause pool exhaustion and deadlocks.