|
| 1 | +# Rust Workspace |
| 2 | + |
| 3 | +Use this guide for work in `cli/`, `core/`, `driver/`, `sql/`, `macros/`, and `ttc/`. |
| 4 | + |
| 5 | +## Ownership |
| 6 | + |
| 7 | +- `cli/`: CLI flags, REPL behavior, output formatting, local web server wiring |
| 8 | +- `core/`: low-level Databend REST client behavior |
| 9 | +- `driver/`: public Rust driver API, query execution, parameter binding |
| 10 | +- `sql/`: shared SQL parsing/value decoding/encoding logic |
| 11 | +- `macros/`: proc-macro behavior |
| 12 | +- `ttc/`: test-container utilities; touch only when the task is explicitly about TTC |
| 13 | + |
| 14 | +## Change Routing |
| 15 | + |
| 16 | +- CLI UX changes usually belong in `cli/`. |
| 17 | +- Protocol behavior, row decoding, type mapping, and parameter binding usually belong in `driver/`, `sql/`, or `core/`. |
| 18 | +- Do not move reusable logic into `cli/` if bindings or driver users should share it. |
| 19 | +- If a change affects a public API or observable query behavior, check whether bindings or docs also need updates. |
| 20 | + |
| 21 | +## Validation |
| 22 | + |
| 23 | +- Prefer targeted Rust validation first when the scope is narrow. |
| 24 | +- For general Rust changes, run `make test`. |
| 25 | +- For broad or user-facing changes, run `make check`. |
| 26 | +- This repo ignores `Cargo.lock`. If local Rust results differ from CI and the change may depend on dependency resolution, check whether a stale local `Cargo.lock` is masking the issue. Regenerate or remove it only as a targeted troubleshooting step, not as a default workflow. |
| 27 | + |
| 28 | +`make check` currently runs: |
| 29 | + |
| 30 | +- `cargo fmt --all -- --check` |
| 31 | +- `cargo clippy --all-targets --all-features -- -D warnings` |
| 32 | +- `cargo deny check` |
| 33 | +- `cargo machete` |
| 34 | +- `hawkeye check` |
| 35 | +- `typos` |
| 36 | + |
| 37 | +If local tooling is missing, report that explicitly instead of silently skipping it. |
| 38 | + |
| 39 | +## Response Expectations |
| 40 | + |
| 41 | +- Summarize the behavior change, not just the files touched. |
| 42 | +- List the exact test or check commands that ran. |
| 43 | +- If you skipped validation, say what was skipped and why. |
0 commit comments