A database written in Rust without any unsafe code!
cargo build
will build the project in debug mode [1]cargo build --release
will build the project with optimizations on <- This takes almost twice the amount of time to build- The
--release
flag [2] will use the optimized build to run and can be used with allcargo
commands cargo run
will run the project. But there isn't really anything in the main function. Everything is written in the form of tests.cargo test
will launch the tests one by one (in alphabetical order), and only show the result i.e. pass or failcargo test -- --nocapture
will also launch tests one by one (in alphabetical order) but will also show the outputs/errorscargo test -- --nocapture <test-name>
will launch just the specified test and will show outputs/errors [3]- Sample inputs for the test are in the sampleinputs file and are also included as comments in each test
- There is a make-file but because cargo does most things it's not really required. I only used it for additional cleaning of my scratch files.
- The make-file uses Cargo-Make which is an external crate (library) but I had it locally installed and it's not part of the project dependencies
- The only external crate is LALRPOP which is the parser. However, LALRPOP has about 95 dependencies, which is the reason for the large compile times
- LALRPOP has it's own lexer and because the creator's intention was to simplify Bison and Flex, it has a lot of macros and shortcuts that make the parser very easy to write
- I've included the TPCH 10MB files in the tpch/ folder
- All file paths are built in main as the Rust
PATH
trait that handles UNIX to Windows conversions - For paths, Rust uses the folder with cargo.toml as the source
- Cargo also has a built-in linter that can be called using
cargo clippy
, but due to LALRPOP there are a lot of warning (all of which are help hints) - The release version that cargo builds is not meant to be built over and over again and is very slow. It should not be used if the files are going to be changed
- To test the release version use
cargo test --release -- --nocapture <test-name>