Skip to content

DarshJDB v0.3.3 — Executor Rewire + SqliteStore::query + mlua ddb.kv.*

Choose a tag to compare

@darshjme darshjme released this 15 Apr 09:03
· 34 commits to main since this release

[0.3.3] - 2026-04-15 — Executor Rewire + SqliteStore::query + mlua ddb.kv

Sprint internally referred to as "v0.3.2.1" in agent SUMMARY files
and DEFERRED.md. Released as v0.3.3 because Cargo workspace versions
are strict three-part semver — the post-release "0.3.2.1" naming is
not a valid cargo version field. No semantic difference; this is
the patch release immediately following v0.3.2.

Closes the two integration deferrals from the v0.3.2 sprint so the
SQLite backend has a real read path and the DarshanQL executor knows
which dialects can run which statement types.

Added

  • SqliteStore::query real implementation — the v0.3.2 stub that
    returned InvalidQuery for every plan is gone. SqliteStore::query
    now binds serde_json::Value params through a small ToSql adapter,
    expands the v0.3.2 M-3 __UUID_LIST__ token into per-uuid ?N
    placeholders for nested-plan resolution, executes via rusqlite on a
    blocking task, and materialises rows in the same QueryResultRow
    JSON shape PgStore::query returns so downstream consumers see no
    shape drift across backends. Plans carrying the
    __SQLITE_VECTOR_UNSUPPORTED__ /
    __SQLITE_COSINE_DISTANCE_UNSUPPORTED__ sentinels are refused up
    front with a clear InvalidQuery message.
  • SqlDialect capability gates — three new methods
    (supports_ddl, supports_graph_traversal, supports_hybrid_search)
    with default-true so PgDialect inherits the v0.3.1 surface
    unchanged. SqliteDialect overrides all three to false. The
    DarshanQL executor checks them at dispatch time.
  • darshql::ExecutorContext — a {pool, Arc<dyn Store>, Arc<dyn SqlDialect>} bundle threaded through every executor
    function. The HTTP entry point keeps the existing
    execute(&PgPool, …) signature for backwards compatibility and
    constructs the context internally; new call sites (tests, future
    portable runners) use execute_with_context directly.
  • tests/sqlite_e2e_query.rs — six end-to-end integration tests
    covering bare SELECT, $where Eq, $where Neq, $limit + $offset,
    $order ASC, and the empty-result case against an in-memory
    SqliteStore driven through plan_query_with_dialect + the new
    Store::query path. Plus two matching store::sqlite::tests
    unit tests and three new query::dialect::tests capability checks.

Added — mlua ddb.kv.* host API

  • MluaContext.cache: Arc<DdbCache> — the v0.3.2 stub fields
    for ddb.kv.get/set/del are gone. MluaContext now carries the
    cache handle alongside the store + dialect, and main.rs wires
    it from a single shared_ddb_cache: Arc<DdbCache> constructed
    before AppState::with_pool so REST/RESP3 dispatchers and the
    Lua function runtime hold the same Arc — Lua writes from a
    server function are immediately visible to subsequent REST
    cache GETs and vice versa.
  • ddb.kv.get(key) — returns a Lua string for UTF-8 values,
    nil for missing keys, and raises a Lua RuntimeError if a
    present value is not valid UTF-8 (binary blobs belong in object
    storage, not the string-shaped Lua boundary).
  • ddb.kv.set(key, value [, ttl_seconds]) — accepts an
    optional trailing Option<u64> TTL. 0 is treated as
    "no expiry" so dynamic-TTL callers don't need to special-case
    the zero literal.
  • ddb.kv.del(key) — returns a bool indicating whether the
    key existed across any cache tier prior to deletion.
  • 5 new mlua tests exercising roundtrip, TTL expiry, deletion,
    missing-key, and the non-UTF-8 error path. The total mlua test
    count is now 30 passing (up from 23 in v0.3.2).
  • Stub-error assertion trimmed — the v0.3.2 mlua hardening
    sprint added a ddb_stubs_all_raise_lua_error test that loop-
    asserted ddb.kv.* raised NotYetImplemented. That assertion
    is now wrong; the kv methods are removed from the loop and the
    test continues to guard the still-stubbed ddb.notify and
    friends (if any).

Changed

  • DarshanQL executor — Tier 2 statement-type gates. DEFINE TABLE, DEFINE FIELD, RELATE, SELECT fields containing
    ->edge traversal, and count(->edge) computed fields now check
    ctx.dialect.supports_*() and return InvalidQuery with a
    v0.3.3-tracking message on dialects that don't support them
    (SQLite today). PostgreSQL production behaviour is byte-for-byte
    unchanged because PgDialect inherits the default-true.
  • Workspace version bumped 0.3.2 → 0.3.3 (released as v0.3.3
    because Cargo's strict three-part semver disallows a 0.3.2.1
    version field; sprint files and agent reports retain the
    v0.3.2.1 naming for traceability).

Deferred to v0.3.2.2 / v0.3.3

  • The portable Pg-or-SQLite hookup for SELECT / CREATE / INSERT /
    RETRACT through ctx.store (rather than ctx.pool) is plumbed
    through ExecutorContext but the executor body still reaches for
    the pool directly for the read/write SQL — the SurrealQL-shaped AST
    consumed by query/darshql/executor.rs is independent of the
    JSON-shaped QueryAST driven by plan_query_with_dialect, and the
    v0.3.3 milestone tracks unifying the two planner surfaces so the
    same Store::query path serves both. Until then the gates are the
    safety net.
  • INFO FOR against :schema/* triples on SQLite — the storage
    shape is portable but the planner pieces have not been ported.
    Tracked alongside the DDL gate in v0.3.3.
  • See DEFERRED.md for the full deferral list with rationale.

Full Changelog: v0.3.2...v0.3.3