A new binary is added to the project, the `parts-cli` application. Currently `parts-cli` supports somewhat the same functionality as `parts-web` although using it feels a bit cumbersome. This is because so far only indexes are supported to identify related objects such as attributes, attribute types and parts. This could be improved by also supporting the identification of such related objects as for example attributes also by their names. When implementing that functionality it must be ensured that ids are always checked first and that the "fallback" parameter acts truly as a fallback in order to not confuse it with id wise parameters. The `parts-cli` crate currently resides inside the parts crate. Therefore the readme file is adapted to reflect the new changes. For `parts-cli` to be able to print some structs residing in the library crate `parts`, `fmt::Display` is implemented. Further, in `Value::insert()`, the part being touched is now also fetched from the database. If this part does not exist an error is thrown. This happens before inserting the value in order to check if the part is already existing to ensure that no dangling value is created.
|1 year ago|
|migrations||1 year ago|
|parts||1 year ago|
|parts-cli||1 year ago|
|parts-web||1 year ago|
|.env||1 year ago|
|.gitignore||1 year ago|
|Cargo.lock||1 year ago|
|Cargo.toml||1 year ago|
|README.md||1 year ago|
|Rocket.toml||1 year ago|
|diesel.toml||1 year ago|
Organize the custody of all kinds of parts.
Building And Installing Parts
In order to build Parts the Rust toolchain and the diesel_cli tool are needed. This section shows the typical steps.
Install the Rust toolchain from rustup.rs.
In order for Diesel to be able to handle SQLite databases we need to
install the build dependency
libsqlite3-dev and then build
sudo apt install libsqlite3-dev cargo install diesel_cli --no-default-features --features sqlite
To create the database with diesel run:
diesel migration run
Parts consists of the library
parts, an application with a command
parts-cli and a web application
To build all applications execute:
or to build the release versions:
cargo b --release
cargo's release flag can always be used with build (b) or
Only one of the two applications can be built with:
cargo b --bin parts-cli
for the command line application, or for the web application:
cargo b --bin parts-web
One of the two applications can be started with:
cargo r --bin parts-cli
and the other with:
cargo r --bin parts-web
Parts currently does not support any configuration functionality on
its own. What is still configurable is the location of the database in
.env file and for
Rocket.toml file can also be
used to configure
In this section explains the basic concepts of Parts.
Attributes describe a possible value or property and are put together by a name and a type.
Currently only basic types are implemented.
For each property which should be mapped to a part an attribute has to be created.
A small CLI application which covers the same features as
parts in the browser, this is a bit more straightforward than