#tax #zig #accounting

tigerbeetle-rust

A Tigerbeetle client for Rust

1 unstable release

0.1.0 Oct 26, 2022

#10 in #zig

Apache-2.0

3.5MB
38K SLoC

Zig 35K SLoC // 0.1% comments JavaScript 1.5K SLoC // 0.1% comments Go 1K SLoC // 0.1% comments Shell 232 SLoC // 0.2% comments Batch 115 SLoC // 0.1% comments Pan 30 SLoC Rust 29 SLoC // 0.1% comments SQL 20 SLoC

Contains (Mach-o exe, 2.5MB) pkg/native/x86_64-macos/tigerbeetle, (static library, 1.5MB) pkg/native/x86_64-macos/libtb_client.a

tigerbeetle-rust

TigerBeetle client for Rust.

Under Construction

Development Setup

Prerequisites:

  • rustc 1.62.1 (or possibly as early as 1.13, your mileage may vary)
  • zig 0.9.1
# Step 1 - Pull tigerbeetle
git submodule init
git submodule update 

# Step 2 - Download zig (optional)
# NOTE: (cd ...) only changes directly for the inner command
(cd ./tigerbeetle && ./scripts/install_zig.sh)

# Step 3 - Build tb_client for your platform and use it in rust
TB_TARGET=x86_64-linux
(cd ./tigerbeetle && zig/zig build tb_client -Drelease-safe -Dtarget=$TB_TARGET)
cp ./tigerbeetle/zig-out/libtb_client.a ./pkg/native/$TB_TARGET/libtb_client.a
cp ./tigerbeetle/src/c/tb_client.h ./pkg/native/tb_client.h

# Step 3.5 - Build tigerbeetle binary for `cargo test`
(cd ./tigerbeetle && zig/zig build -Drelease-safe -Dtarget=$TB_TARGET)
cp ./tigerbeetle/zig-out/bin/tigerbeetle ./pkg/native/$TB_TARGET/tigerbeetle

# Step 4 - Build and test tigerbeetle-rust
cargo test

Other clients and documentation

Dependencies