rust-store

rust-store

A single Rust core engine for multi-backend data access — GQL parsing, permission checks, computed columns, command planning and SQL dialect translation, exposed to Node.js and Python through native bindings.

rust-store is the engine behind nodejs-store and py-store. It contains no database driver and performs no IO: it turns a query (GQL) or a write into a backend-agnostic command (MongoDB command JSON) for its host to execute, and translates those commands into parameterized SQL for MySQL / PostgreSQL / SQLite.

cargo add rust-store-core     # Rust core
npm install rust-store-node   # Node.js binding (napi-rs)
pip install rust-store-py     # Python binding (PyO3)

Scenario walkthroughs

Six end-to-end walkthroughs, each with runnable code, the mistakes people make, and the exact limits of the engine:

Scenario What it covers
01 — Embed the core in a Rust service Use rust-store-core as a path dependency: register schemas, plan a query, translate it to SQL, hand the command to your own driver.
02 — Natural language → query compiler Turn model output into a reviewable plan before anything touches a database, and classify rejections by stable error prefixes.
03 — One dialect across four databases Write GQL once, plan to MongoDB command JSON, then translate the same command to parameterized MySQL / PostgreSQL / SQLite.
04 — Node.js / Python parity One Rust core, two bindings: camelCase vs snake_case is the only difference, kept honest by parity suites and golden fixtures.
05 — Reuse the permission model Ownership and role checks live in the schema: the context shape, the creator pseudo-role, owner-condition injection, and the routeOverride caveat.
06 — SQL pushdown limits by dialect What each backend pushes down natively, what degrades to degraded events, and what the engine refuses outright.

Documentation

Hosts and bindings