Documentation menu

Embedded SDK

Dynoxide can be used as a Rust library, calling the database directly without any HTTP overhead. This is the fastest mode - single-digit microsecond operations, no serialisation, no network stack.

It also runs on platforms where DynamoDB Local can't, including iOS.

Add the dependency

[dependencies]
dynoxide-rs = { version = "0.9", default-features = false, features = ["native-sqlite"] }

For encrypted storage:

[dependencies]
dynoxide-rs = { version = "0.9", default-features = false, features = ["encryption"] }

Basic usage

use dynoxide::Database;

// In-memory database (great for tests)
let db = Database::memory().unwrap();

// Persistent, file-backed
let db = Database::new("data.db").unwrap();

// Encrypted (requires the encryption feature)
let db = Database::new_encrypted("data.db", "your-hex-key").unwrap();

The API uses DynamoDB-compatible request and response types as serde_json::Value. You call the same operations you'd call over HTTP - CreateTable, PutItem, Query, and so on - but without the network round trip.

Testing

The embedded mode is particularly useful for integration tests. Each test can spin up its own Database::memory() instance - there's no shared state, no port conflicts, and startup is roughly 0.2ms.

#[test]
fn test_user_creation() {
    let db = Database::memory().unwrap();
    // create table, put item, assert...
}

No test fixtures, no cleanup, no waiting for a server to start. The database exists for the lifetime of the Database value and is dropped automatically.

For the full API surface and feature flags, see the crate documentation on crates.io.