agents/repository-structure.md
Databend is a Rust workspace rooted at Cargo.toml. Start by deciding whether the change belongs to the query engine or the metadata system, then read the closest module README before editing.
src/query/ is the main query engine: SQL parsing, planning, optimization, expression evaluation, execution pipeline, query service integration, and table/storage-facing behavior all converge here. If the task changes SQL behavior, planner output, execution, storage access, or query-side tests, start with src/query/README.md.src/meta/ is the metadata side of the system: metadata types, protocol definitions, compatibility layers, supporting tooling, and the Databend meta-service binaries live here. If the task touches catalog/schema metadata, protobuf compatibility, meta APIs, or databend-meta tooling, start with src/meta/README.md.src/meta/README.md also notes an important boundary: core meta-service implementation has moved to the separate databend-meta repository. Read it early if you suspect the code you need is no longer in this workspace.src/query/README.md as the index for query-side crates. It explains the role of modules such as ast, catalog, expression, functions, pipeline, service, storages, and related support crates.src/query/ast/README.md when the task is about SQL parser structure, grammar internals, or parser-specific development workflow.src/query/functions/README.md when adding or debugging scalar or aggregate functions, function registration, or function-specific tests.src/query/ee_features/README.md when the task involves enterprise query features and you need to confirm which feature layer owns the behavior.src/query/sql/README.md when the task lives in SQL planning, binding, optimizer behavior, or SQL-side planner tests.src/common/.src/binaries/.tests/, including SQL suites under tests/suites/, sqllogic cases, and meta-specific harnesses.benchmark/.scripts/ and docker/._data/.Makefile lists supported top-level tasks.