Expand description
Dactyl — the governed datastore boundary for Decapod.
Interchangeably read and write to local SQLite or cloud-hosted Vercel Neon instances behind a single unified facade.
§Configuration
The active datastore is selected by ambient environment variables — no
init() call and no per-call datastore argument:
| Variable | Required | Meaning |
|---|---|---|
DATASTORE | yes | "sqlite" or "neon". Any other value is a typed error. |
DATASTORE_ROUTE | yes | SQLite file path (sqlite) or Neon/Propodus endpoint URL (neon). |
DATASTORE_TOKEN | no | Opaque bearer token forwarded to the Neon adapter. Ignored by sqlite. |
Each call opens its own short-lived adapter execution and drops it on
return — there is no process-wide connection cache, so workspace and
session isolation is automatic and the public surface is Send + Sync
without any lock.
§Public surface
- [
query] — one entry point for any SQL (read or write). execute— DDL / migration / affected-row operations.transaction— atomic batch of parameterized statements.query!— compile-time SQL literal analyzer.
No init, no read/write split, no optimize flag. The query analyzer
is still available via query::QueryAnalyzer for callers that want
compile-time dialect visibility; runtime dispatch always passes the SQL
straight to the active adapter.
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 aString.
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.
- Statement
- A parameterized SQL statement for batch execution.
Enums§
- Parameter
- A unified database parameter value.
Functions§
- execute
- Execute a DDL / migration / affected-row operation against the active datastore and return the number of affected rows.
- query
- Execute any SQL statement against the active datastore and return its
rows. Reads return the matched rows; writes return any returned rows
(Neon/
RETURNING) or an emptyRowswhen the adapter surfaces no rows. - transaction
- Execute an atomic batch of parameterized statements.