Rust bindings for RayforceDB, a high-performance columnar database designed for analytics and data operations. The core is written in pure C with minimal overhead — combining columnar storage with SIMD vectorization for lightning-fast analytics on time-series and big-data workloads.
The bindings call the core's C API directly (no marshalling shim), so reads are
zero-copy where it counts: a numeric column is exposed as a &[T] slice rather than
copied element by element.
Full Documentation: https://rs.rayforcedb.com/
Features
- Fluent API — chainable, intuitive query builders that read like the operation; real operator overloads for arithmetic, methods for comparisons.
- Zero-Copy & High Performance — build a column in a single
memcpy, read it back as a borrow; minimal overhead between Rust and the RayforceDB runtime via the C API. - Type-Safe — a full value model (atoms, vectors, lists, dicts, tables) with
ToValue/FromValueconversions and optionalchronotemporals. - Lightweight — the core is less than a 1 MB footprint.
- Batteries included — CSV & splayed I/O, binary serialization, and a TCP/IPC client.
Quick Start
use ;
// One live runtime per process; the scope brackets its whole life.
scope?;
┌────────┬─────────┬─────────┬─────────┬───────┐
│ symbol │ max_bid │ min_bid │ avg_ask │ count │
│ SYM │ F64 │ F64 │ F64 │ I64 │
├────────┼─────────┼─────────┼─────────┼───────┤
│ GOOG │ 202.0 │ 200.0 │ 211.0 │ 3 │
├────────┴─────────┴─────────┴─────────┴───────┤
│ 1 rows (1 shown) 5 columns (5 shown) │
└──────────────────────────────────────────────┘
Installation
The RayforceDB core and the rayforce-q IPC client are C. Both ship inside the
crate, so nothing is fetched at build time — the build script compiles them and statically
links librayforce.a.
# Cargo.toml
[]
= { = "https://github.com/RayforceDB/rayforce-rs" }
Requirements: a C toolchain (make, clang) and libclang for bindgen.
The C sources are git submodules addressed over SSH (git@github.com:), and Cargo
fetches a git dependency's submodules itself. Without a GitHub SSH key, rewrite the
URLs to https and make Cargo fetch through git, which honours the rewrite:
# ~/.cargo/config.toml
[]
= true
A crates.io dependency needs none of this — the sources ship inside the crate.
Working on the bindings
The C sources live in git submodules under rayforce-sys/vendor/, addressed over SSH,
so a checkout needs them initialized:
# in an existing clone:
Without a GitHub SSH key, rewrite the submodule URLs to https once with
git config --global url."https://github.com/".insteadOf "git@github.com:".
Choosing the core version
Each release links one pinned core version. It lives in two places that must agree — the
rayforce-sys/vendor/rayforce submodule, and the CORE_VERSION / CORE_COMMIT constants
in rayforce-sys/build.rs that get stamped into librayforce.a (a crate unpacked from
crates.io has no git history for the core's Makefile to read a version from).
To move the pin, move both:
rayforce-sys/vendor/rayforce-q works the same way, minus the constants — nothing is
stamped from it.
To build against a core you are changing instead, point the build script at your own checkout. These take precedence over the vendored copies:
Such a checkout is built in place, so incremental state is preserved — except across a
core-flavour switch. Release and debug objects share every filename, so the first build
after RAYFORCE_CORE_DEBUG changes drops every object under src/ and the
librayforce.a beside them, and records the flags in an untracked .stamp. Nothing
tracked by git is touched.
bindgen locates libclang via LIBCLANG_PATH. This is deliberately not set in the
repo's .cargo/config.toml. If bindgen can't auto-detect libclang, set it yourself:
# macOS (CTL):
# Linux:
The chrono is on by default for date/time/timestamp conversions.
Built with ❤️ for high-performance data processing | MIT Licensed | RayforceDB