/braid-lib

Primary LanguageRustGNU General Public License v3.0GPL-3.0

braid library

Build Status rustdoc

This is the braid library. Most users can use the server, which provides higher-level methods for working with braid databases. Linking directly against the library would be necessary if you want to make a new datastore implementation, or if you want to work at a lower-level than the server affords.

Pluggable datastores

Braid stores graph data in datastores. Datastores are pluggable: there is built in support for postgres and rocksdb, but you can implement a new custom datastore.

Postgres

To use the postgres datastore, add this to your Cargo.toml:

[dependencies.braid]
git = "https://github.com/braidery/braid-lib"
features = ["postgres-datastore"]

RocksDB

To use the rocksdb datastore, add this to your Cargo.toml:

[dependencies.braid]
git = "https://github.com/braidery/braid-lib"
features = ["rocksdb-datastore"]

Custom datastores

To implement a custom datastore, you need to implement the Datastore and Transaction traits. See the postgres and rocksdb datastores as examples.

To help you get off the ground faster, we've defined some standard tests that can execute against any datastore and check for common bugs and regressions. See the postgres datastore tests for an example.

Running tests

Run ./test.sh.

Running benchmarks

Run ./test.sh --bench.