[package] name = "dynoxide-rs" version = "4.1.0" edition = "2024" description = "An embeddable DynamoDB emulator backed by SQLite. Starts in under a millisecond, and is verified against real AWS by a public conformance suite." license = "MIT OR Apache-2.0" repository = "https://github.com/nubo-db/dynoxide" homepage = "https://github.com/nubo-db/dynoxide" documentation = "https://docs.rs/dynoxide-rs" readme = "README-crate.md" keywords = ["dynamodb", "sqlite", "emulator", "aws", "testing"] categories = ["database-implementations", "emulators"] rust-version = "1.89" [lib] name = "dynoxide" # rlib for native consumers (bin, tests, benches); cdylib for the wasm-bindgen # build (wasm-pack emits the .wasm module from the cdylib). crate-type = ["cdylib", "rlib"] [features] default = ["native-sqlite", "http-server", "mcp-server", "import", "cli"] # Marker feature for the CLI binary (`src/main.rs`). The binary always needs # clap, a log subscriber and one of `http-server`, `mcp-server` or `import`; # `[[bin]] required-features` keys off `cli` so the binary is skipped in # library builds. The server features don't imply it, so a library that embeds # the HTTP or MCP server compiles neither clap nor the subscriber: the library # logs through `tracing` alone and leaves the subscriber to the application. cli = ["dep:clap", "dep:tracing-subscriber"] # Operation counters for the performance questions that are about how many times # something happens rather than how long it takes. Off by default; compiles to # nothing when absent. See `src/bench_counters.rs`. bench-counters = [] http-server = ["dep:axum", "dep:tokio", "dep:tower-http", "dep:tracing", "dep:socket2", "dep:crc32fast", "dep:windows-sys"] native-sqlite = ["dep:rusqlite", "rusqlite/bundled"] _has-encryption = ["dep:zeroize"] encryption = ["_has-encryption", "rusqlite/bundled-sqlcipher-vendored-openssl"] encryption-cc = ["_has-encryption", "rusqlite/bundled-sqlcipher"] encrypted-server = ["encryption", "http-server", "cli"] encrypted-server-cc = ["encryption-cc", "http-server", "cli"] encrypted-full = ["encryption", "http-server", "mcp-server", "import", "cli"] mcp-server = ["dep:rmcp", "dep:schemars", "dep:tokio", "dep:tokio-util", "dep:axum", "dep:tracing", "dep:libc", "dep:directories", "dep:subtle", "dep:socket2", "dep:windows-sys"] import = ["cli", "dep:toml", "dep:fake", "dep:sha2", "dep:hmac", "dep:zeroize", "dep:flate2", "dep:indicatif", "dep:zstd", "dep:tempfile"] # Real wasm SQLite backend. dynoxide compiles to wasm32-unknown-unknown and # runs against the official @sqlite.org/sqlite-wasm engine over a wasm-bindgen # bridge, persisting to OPFS. # Conformant on what it implements, but several operations are still missing # (see the conformance note in the README). wasm-sqlite = ["dep:wasm-bindgen", "dep:js-sys", "dep:wasm-bindgen-futures", "dep:web-sys", "dep:async-lock"] # Browser smoke-test entry point over the wasm-sqlite backend. Opt-in so the # `#[wasm_bindgen]` harness export stays out of the production wasm build. wasm-harness = ["wasm-sqlite"] # Backward-compatible alias - identical to default features full = ["native-sqlite", "http-server", "mcp-server", "import", "cli"] [dependencies] rusqlite = { version = "0.43", features = ["backup", "functions"], optional = true } serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["raw_value"] } thiserror = "2" base64 = "0.22" bigdecimal = "0.4" uuid = { version = "1", features = ["v4", "v5", "v7"] } md5 = "0.7" # Cross-platform time. Re-exports std::time on native (zero cost); on wasm32 it # sources Instant/SystemTime from the browser clock so the shared time-bearing # paths (idempotency cache, created_at stamps, SystemClock) do not panic. web-time = "1" # Drives the always-ready native handler futures to completion for the # synchronous `Database` facade. A minimal block_on that never spawns threads, # so it is safe to call from inside the tokio-based HTTP/MCP servers. pollster = "0.4" # `encryption` wipes the key once the PRAGMA has taken it. `import` wraps the # salt the same way: a salt is cloned into every rule that names it and held # for the whole run, so redacting `Debug` alone would leave copies in freed # memory. zeroize = { version = "1", optional = true } # Optional HTTP server dependencies axum = { version = "0.8", optional = true } tokio = { version = "1.46", features = ["full"], optional = true } tower-http = { version = "0.6", features = ["cors", "set-header", "trace"], optional = true } clap = { version = "4", features = ["derive", "env"], optional = true } tracing = { version = "0.1", optional = true } tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true } socket2 = { version = "0.6", optional = true } crc32fast = { version = "1", optional = true } # Optional MCP server dependencies rmcp = { version = "3.9", features = ["server", "transport-io", "transport-streamable-http-server"], optional = true } schemars = { version = "1", optional = true } tokio-util = { version = "0.7", optional = true } libc = { version = "0.2", optional = true } directories = { version = "6", optional = true } subtle = { version = "2", optional = true } # Optional import dependencies toml = { version = "0.8", optional = true } fake = { version = "3", features = ["derive"], optional = true } sha2 = { version = "0.10", optional = true } # `hash` keys HMAC-SHA256 on the salt. The `SHA256(salt || value)` it replaced # ran salt and value together as one byte string with no boundary between # them, and inherited SHA-256's length extension. hmac = { version = "0.12", optional = true } flate2 = { version = "1", optional = true } indicatif = { version = "0.18", optional = true } zstd = { version = "0.13", optional = true } tempfile = { version = "3", optional = true } # wasm SQLite backend dependencies, enabled by the `wasm-sqlite` feature. # All four are already in the lock (pulled by uuid/web-time on wasm), so this # only marks them as direct, feature-gated dependencies. wasm-bindgen = { version = "0.2", optional = true } js-sys = { version = "0.3", optional = true } wasm-bindgen-futures = { version = "0.4", optional = true } web-sys = { version = "0.3", optional = true, features = ["console"] } # Async mutex serialising access to the single SQLite connection. A std # mutex held across the bridge await would deadlock concurrent callers on the # single-threaded runtime; this queues them instead. async-lock = { version = "3", optional = true } # uuid needs an explicit randomness source on wasm32-unknown-unknown. The `js` # feature wires its RNG to the browser crypto via wasm-bindgen, so the wasm # build does not need getrandom's backend cfg. Native targets are unaffected # and keep the default getrandom-backed RNG. [target.'cfg(target_arch = "wasm32")'.dependencies] uuid = { version = "1", features = ["js"] } # The HTTP server sets SO_EXCLUSIVEADDRUSE on its listener, which socket2 # does not expose, so it needs raw setsockopt access. [target.'cfg(windows)'.dependencies] windows-sys = { version = "0.61", features = ["Win32_Networking_WinSock"], optional = true } [dev-dependencies] tokio = { version = "1.46", features = ["full"] } reqwest = { version = "0.12", features = ["json"] } proptest = "1" # `default-features = false` drops the SDK's `rustls` feature, which is the # legacy hyper 0.14 TLS stack rather than the modern client the same default # set already selects. That path carried its own h2 0.3, rustls 0.101 and # rustls-pemfile 1.0, none of which have a patched release, and all of which # were reported against a dev-dependency the published crate never ships. # The minimums keep aws-smithy-json at 0.63 or later (GHSA-8ffr-xgwf-xj56). # These releases need Rust 1.94.1, above the crate's 1.89, so without them the # MSRV-aware resolver would fall back to the vulnerable versions. Only the # tests and benchmarks build them. aws-sdk-dynamodb = { version = "1.130", default-features = false, features = [ "default-https-client", "rt-tokio", ] } aws-config = { version = "1.12", features = ["behavior-version-latest"] } aws-credential-types = "1" # Already in the tree behind `default-https-client`; named directly so the SDK # integration test can hand the client a plain-HTTP connector. Without one the # SDK builds its default HTTPS connector and reads the OS trust store, for a # test whose endpoint is `http://127.0.0.1`. See tests/aws_sdk_integration.rs. aws-smithy-http-client = { version = "1", features = ["default-client"] } tempfile = "3.25.0" # wasm-pack runs wasm-opt on release builds. Enable the wasm features rustc # emits for wasm32-unknown-unknown so wasm-opt validates the input, then # optimise for size. Without these it aborts with "all used features should be # allowed". [package.metadata.wasm-pack.profile.release] wasm-opt = [ '-Os', '--enable-bulk-memory', '--enable-sign-ext', '--enable-mutable-globals', '--enable-nontrapping-float-to-int', '--enable-multivalue', '--enable-reference-types', ] [profile.release] opt-level = "s" lto = true codegen-units = 1 panic = "abort" strip = true [[bin]] name = "dynoxide" path = "src/main.rs" required-features = ["cli"]