Native FFI
TaiDB can build a native shared library with a C ABI. This is useful for languages that can call C libraries, but it is a lower-level integration path than the Rust API or CLI.
cargo build --release --features native-ffiArtifacts:
- macOS:
target/release/libtaidb.dylib - Linux:
target/release/libtaidb.so - Windows:
target/release/taidb.dll - Header:
include/taidb.h
Header
Section titled “Header”Include:
#include "taidb.h"The header defines the C ABI functions and structs for opening a database, writing values, reading values, inspecting stats, and releasing allocated resources.
Examples
Section titled “Examples”Examples are available in the repository:
examples/c/native_ffi.cexamples/python/native_ffi.pyexamples/go/native_ffi.goexamples/typescript/native_ffi.ts
Run the native smoke test:
make native-smokeOperational notes
Section titled “Operational notes”- Build the shared library for each target platform.
- Ship the library next to the application or configure the platform loader.
- Keep the C header and shared library from the same TaiDB version.
- Treat FFI as an advanced path until the API is frozen for
1.0.0.