This folder contains crates that are full of examples that demonstrate various usages of BonsaiDb. The examples are grouped into crates by two things:
- The feature flags they enable in the
bonsaidb
crate - Shared list of dependencies
This approach to organizing examples will keep individual example build times as low as possible, as only the dependencies and features needed for each example will be built.
Source code: basic-local/examples/basic-local.rs
cargo run --example basic-local
Source code: basic-local/examples/basic-local-multidb.rs
cargo run --example basic-local-multidb
Source code: basic-local/examples/view-examples.rs
cargo run --example view-examples
Async version: basic-local/examples/view-examples-async.rs
cargo run --example view-examples-async --features async
Source code: basic-local/examples/keyword-search.rs
cargo run --example keyword-search
Source code: view-histogram/examples/view-histogram.rs
cargo run --example view-histogram
Source code: basic-local/examples/pubsub.rs
cargo run --example pubsub
Source code: basic-local/examples/key-value-store.rs
cargo run --example key-value-store
Async version: basic-local/examples/key-value-store-async.rs
cargo run --example key-value-store-async --features async
Source code: ../crates/bonsaidb-files/examples/basic-files.rs
cargo run --example basic-files
Async version: ../crates/bonsaidb-files/examples/basic-files-async.rs
cargo run --example basic-files-async --features async
Source code: ../crates/bonsaidb-files/examples/file-configs.rs
cargo run --example file-configs
Source code: basic-server/examples/basic-server.rs
cargo run --example basic-server
Source code: basic-server/examples/users.rs
cargo run --example users
Source code: basic-server/examples/cli.rs
cargo run --example cli
Source code: acme/examples/acme.rs
cargo run --example acme
Source code: axum/examples/axum.rs
cargo run --example axum