Skip to content

Installation

Add TensorDB to your Cargo.toml:

[dependencies]
tensordb = "0.28"

Or use cargo add:

Terminal window
cargo add tensordb

Build from Source

Terminal window
git clone https://github.com/tensor-db/TensorDB.git
cd TensorDB
cargo build --release

Optional Features

TensorDB supports optional compile-time features for hardware acceleration:

FeatureFlagDescription
C++ Acceleration--features nativeEnables C++ acceleration via cxx for hashing, compression, and bloom filters
SIMD--features simdHardware-accelerated bloom filters and checksums
io_uring--features io-uringLinux async I/O for reduced syscall overhead
Terminal window
# Build with all optional features
cargo build --release --features native,simd,io-uring

Python Bindings

Terminal window
pip install tensordb
import tensordb
db = tensordb.open("my_data")
db.sql("CREATE TABLE users (id TEXT, name TEXT)")
db.sql("INSERT INTO users VALUES ('u1', 'Alice')")
results = db.sql("SELECT * FROM users")

See the Python integration guide for details.

Node.js Bindings

Terminal window
npm install tensordb
const { Database } = require('tensordb');
const db = Database.open('my_data');
db.sql("CREATE TABLE users (id TEXT, name TEXT)");
db.sql("INSERT INTO users VALUES ('u1', 'Alice')");
const results = db.sql("SELECT * FROM users");

See the Node.js integration guide for details.

CLI

The TensorDB CLI provides an interactive SQL shell:

Terminal window
# Build the CLI
cargo build --release -p tensordb-cli
# Run it
./target/release/tensordb-cli ./my_data
tensordb> CREATE TABLE test (id TEXT, value TEXT);
OK
tensordb> INSERT INTO test VALUES ('k1', 'hello');
1 row inserted
tensordb> SELECT * FROM test;
id | value
---+------
k1 | hello

License

TensorDB is licensed under the PolyForm Noncommercial License 1.0.0. You may use it freely for personal, educational, research, and non-commercial purposes. Commercial use requires a paid license — contact us for details.

System Requirements

  • Rust: 1.75+ (stable)
  • OS: Linux, macOS, Windows
  • io_uring: Linux 5.1+ (optional)
  • C++ toolchain: Required only for --features native