coDB is a relational database built from scratch.
The project is organized as a Cargo workspace with multiple crates for modularity and improved compile times.
- Binary crate:
cargo new <BINARY_NAME> --vcs none --bin
- Library crate:
cargo new <LIBRARY_NAME> --vcs none --lib
Ensure the root Cargo.toml includes the new crate under [workspace].members and new-crate/Cargo.toml includes rust-version.workspace = true under package. Add those manually if needed.
To use one crate from another within the workspace (e.g. crateA imports crateB), add this to crateA/Cargo.toml:
[dependencies]
crateB = { path = "../crateB" }If an external crate is needed by only one coDB crate, add it to that crate's Cargo.toml.
For example, to add external-1 to the query crate, add it in query/Cargo.toml.
If an external crate is used by multiple workspace crates, add it to the root Cargo.toml under [workspace.dependencies] and reference it from each crate with workspace = true.
For example, add external-common to the root Cargo.toml:
[workspace.dependencies]
external-common = "x.y"Then in query/Cargo.toml and engine/Cargo.toml:
[dependencies]
external-common.workspace = true To update rust version you should update:
rust_versionfield in rootCargo.tomlSet up Rust 1.Xstep in github actions (github/workflows/build_and_test.yaml)
To build and run this project, you need Rust installed. You can install it from https://rust-lang.org or via rustup.
To run a binary crate:
cargo run -p <BINARY_NAME>Run all tests:
cargo testRun tests for a specific crate:
-
run it from crate's directory:
- enter crate's directory:
cd <CRATE_NAME>
- Run tests:
cargo test
- enter crate's directory:
-
run it from root of the project by specyfing crate name:
- Binary crate:
cargo test --bin <CRATE_NAME>
- Library crate:
cargo test --lib <CRATE_NAME>
- Binary crate:
To generate docs run:
cargo doc --document-private-items --open