pub struct SqliteAdapter { /* private fields */ }Expand description
A SQLite database, materialized as an arbor.
Implementations§
Source§impl SqliteAdapter
impl SqliteAdapter
Sourcepub fn open(path: &Path) -> Result<Self, SqliteError>
pub fn open(path: &Path) -> Result<Self, SqliteError>
Open a database file (read-only): the catalog now, each table’s rows on first touch (the connection stays owned by the adapter).
Sourcepub fn open_with_refs(
path: &Path,
refs: &[(String, String)],
) -> Result<Self, SqliteError>
pub fn open_with_refs( path: &Path, refs: &[(String, String)], ) -> Result<Self, SqliteError>
[open], with a declared-references document: each (field, container) pair supplies the edge the schema does not
declare (see quarb_relational::parse_refs).
Sourcepub fn open_filtered(
path: &Path,
table: &str,
where_sql: &str,
) -> Result<Self, SqliteError>
pub fn open_filtered( path: &Path, table: &str, where_sql: &str, ) -> Result<Self, SqliteError>
[open], with one table’s fetch filtered by a WHERE clause
(partial pushdown; the engine re-applies the predicates).
Sourcepub fn open_filtered_with_refs(
path: &Path,
table: &str,
where_sql: &str,
refs: &[(String, String)],
) -> Result<Self, SqliteError>
pub fn open_filtered_with_refs( path: &Path, table: &str, where_sql: &str, refs: &[(String, String)], ) -> Result<Self, SqliteError>
[open_filtered], with a declared-references document.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SqliteError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SqliteError>
Open a database held entirely in memory — the bytes of a
.db file that never touched a filesystem (the browser’s
uploaded files). Deserializes read-only, then materializes
eagerly, as SqliteAdapter::load does.
Sourcepub fn load(conn: &Connection) -> Result<Self, SqliteError>
pub fn load(conn: &Connection) -> Result<Self, SqliteError>
Materialize every user table of an open connection, eagerly (in-memory databases, tests).
Sourcepub fn load_with_refs(
conn: &Connection,
refs: &[(String, String)],
) -> Result<Self, SqliteError>
pub fn load_with_refs( conn: &Connection, refs: &[(String, String)], ) -> Result<Self, SqliteError>
[load], with a declared-references document.
Trait Implementations§
Source§impl AstAdapter for SqliteAdapter
impl AstAdapter for SqliteAdapter
Source§fn children(&self, node: NodeId) -> Vec<NodeId>
fn children(&self, node: NodeId) -> Vec<NodeId>
node, in document order. Read moreSource§fn name(&self, node: NodeId) -> Option<String>
fn name(&self, node: NodeId) -> Option<String>
node — the label of its incoming tree edge. Read moreSource§fn property(&self, node: NodeId, name: &str) -> Option<Value>
fn property(&self, node: NodeId, name: &str) -> Option<Value>
node — ::prop. None if absent.Source§fn default_value(&self, node: NodeId) -> Option<Value>
fn default_value(&self, node: NodeId) -> Option<Value>
node — bare ::, adapter-specific
(a filesystem adapter returns file content).Source§fn metadata(&self, node: NodeId, key: &str) -> Option<Value>
fn metadata(&self, node: NodeId, key: &str) -> Option<Value>
;;;key (a filesystem adapter’s
size, modified, permissions, …). None if absent.Source§fn resolve(
&self,
node: NodeId,
property: &str,
hint: Option<&str>,
) -> Option<NodeId>
fn resolve( &self, node: NodeId, property: &str, hint: Option<&str>, ) -> Option<NodeId>
::property~>hint maps node’s
property (a value that references another node) to its target,
with an optional adapter-specific relation hint. A JSON
adapter resolves a $ref JSON Pointer; None if unresolvable.Source§fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
node, as (label, target) pairs,
for -> navigation (a filesystem adapter’s symlinks).Source§fn backlinks(&self, node: NodeId) -> Vec<(String, NodeId)>
fn backlinks(&self, node: NodeId) -> Vec<(String, NodeId)>
node, as (label, source) pairs, for
<- navigation. May be expensive (an adapter that does not
precompute edges must search for referrers).Source§fn traits(&self, _node: NodeId) -> Vec<String>
fn traits(&self, _node: NodeId) -> Vec<String>
node — its adapter-defined classifications,
used by <trait> navigation filters (e.g. a filesystem
adapter’s <dir>, <code>, <image>).Source§fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
node whose edge name is exactly name —
the engine’s fast path for name-matcher child hops. The
default filters children; an adapter
whose containers cannot be enumerated (permission-scoped or
unbounded remote trees) overrides this with a direct,
name-addressed lookup. Must be observationally identical to
the default wherever enumeration works. The adapter owns the
name test: it may deliberately alias — resolve a name to a
node whose edge name differs (git revision syntax landing on
a hash-named commit) — and the engine will not re-filter.Source§fn link_property(
&self,
_source: NodeId,
_label: &str,
_target: NodeId,
_name: &str,
) -> Option<Value>
fn link_property( &self, _source: NodeId, _label: &str, _target: NodeId, _name: &str, ) -> Option<Value>
source --label--> target — the
$-::prop read. Adapters whose edges carry data (a property
graph’s relationship properties) override this; None if the
edge is bare or unknown. Where parallel edges share source,
label, and target, the adapter answers for one of them,
consistently.Source§fn quantifier_bound(&self) -> usize
fn quantifier_bound(&self) -> usize
+, *, {m,}) expand, and the ceiling of any
explicit {m,n} (the effective upper bound is min(n, N_max)).
An adapter whose natural structures run deep may raise it; the
CLI overrides it per run (qua --quantifier-bound).Source§fn allow_shell(&self) -> bool
fn allow_shell(&self) -> bool
sh(...) pipeline stage may run external
commands. False by default — query text stays inert data —
and enabled per run by the CLI (qua --allow-shell) through
the AllowShell wrapper.Source§fn invocation_instant(&self) -> Option<(i64, u32)>
fn invocation_instant(&self) -> Option<(i64, u32)>
now() denotes (spec: The Temporal
Fragment, Determinism): one UTC timeline point bound by the
runner BEFORE evaluation begins — evaluation itself never
reads a clock. None by default (a library run is fully
deterministic; now() reads as null); the CLI binds it at
startup — pinnable with qua --now — through the
WithNow wrapper.Source§fn unit_scale(&self, expr: &str) -> Option<(f64, String)>
fn unit_scale(&self, expr: &str) -> Option<(f64, String)>
[::range < '50kellicam'] resolves through the
document’s .!units imports.