Skip to main content

Crate dactyl_db

Crate dactyl_db 

Source
Expand description

Dactyl — the governed datastore boundary for Decapod.

The public API is intentionally tiny. There is no init. There is no configuration step. The first call to read or [write] establishes the connection.

use dactyl::Rows;

let rows: Rows = dactyl::read("select id, title from todos", true)?;

§How dactyl picks the adapter

On the first call, dactyl consults the environment for the target adapter:

  • DATASTORE — must be set to either "sqlite" or "neon".
  • DATASTORE_ROUTE — when DATASTORE is "sqlite", this is the path to the SQLite file. When DATASTORE is "neon", this is the Propodus endpoint URL.

If the new DATASTORE variable is not set, dactyl falls back to the legacy environment variables (DACTYL_NEON_ENDPOINT, DACTYL_NEON_BEARER, DACTYL_SQLITE_PATH, DACTYL_SQLITE_ROOT) for backwards compatibility.

The connection is held in a OnceLock for the lifetime of the process.

Re-exports§

pub use crate::error::DactylError;

Modules§

adapter
Adapter trait — internal to dactyl.
error
Public error type for dactyl.
query
Query analysis pipeline.

Macros§

query
dactyl::query!("literal") — returns the rewritten SQL as a String.

Structs§

Row
One result row. Carries the column names (shared across the result) plus the per-cell JSON values.
Rows
A collection of result rows.

Functions§

read
Execute a read against the dactyl connection.
write
Execute a write against the dactyl connection.