pub struct RedDBRuntime { /* private fields */ }Implementations§
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_config_command( &self, raw_query: &str, cmd: &ConfigCommand, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn config_watch_events_since( &self, collection: &str, key: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
pub fn config_watch_events_since_prefix( &self, collection: &str, prefix: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn in_memory() -> Result<RedDBRuntime, RedDBError>
Sourcepub fn lock_manager(&self) -> Arc<LockManager> ⓘ
pub fn lock_manager(&self) -> Arc<LockManager> ⓘ
Handle to the intent-lock manager for tests + introspection.
Production code acquires via LockerGuard::new(rt.lock_manager())
rather than touching the manager directly.
pub fn with_options(options: RedDBOptions) -> Result<RedDBRuntime, RedDBError>
pub fn with_pool( options: RedDBOptions, pool_config: ConnectionPoolConfig, ) -> Result<RedDBRuntime, RedDBError>
pub fn db(&self) -> Arc<RedDB> ⓘ
Sourcepub fn index_store_ref(&self) -> &IndexStore
pub fn index_store_ref(&self) -> &IndexStore
Direct access to the runtime’s secondary-index store.
Used by bulk-insert entry points (gRPC binary bulk, HTTP bulk,
wire bulk) that need to push new rows through the per-index
maintenance hook after store.bulk_insert returns.
Sourcepub fn schema_vocabulary_lookup(&self, token: &str) -> Vec<VocabHit>
pub fn schema_vocabulary_lookup(&self, token: &str) -> Vec<VocabHit>
Lookup token in the schema-vocabulary reverse index. Returns
an owned Vec<VocabHit> because the underlying read lock
cannot be borrowed across the call boundary; the slice from
SchemaVocabulary::lookup is cloned per hit.
Sourcepub fn set_auth_store(&self, store: Arc<AuthStore>)
pub fn set_auth_store(&self, store: Arc<AuthStore>)
Inject an AuthStore into the runtime. Called by server boot
after the vault has been bootstrapped, so that Value::Secret
auto-encrypt/decrypt can reach the vault AES key.
Sourcepub fn vault_kv_get(&self, key: &str) -> Option<String>
pub fn vault_kv_get(&self, key: &str) -> Option<String>
Read a vault KV secret from the configured AuthStore, if present.
Sourcepub fn vault_kv_try_set(
&self,
key: String,
value: String,
) -> Result<(), RedDBError>
pub fn vault_kv_try_set( &self, key: String, value: String, ) -> Result<(), RedDBError>
Write a vault KV secret and fail if the encrypted vault write is unavailable or cannot be made durable.
Sourcepub fn set_oauth_validator(&self, validator: Option<Arc<OAuthValidator>>)
pub fn set_oauth_validator(&self, validator: Option<Arc<OAuthValidator>>)
Inject an OAuthValidator into the runtime. When set, HTTP and
wire transports try OAuth JWT validation before falling back to
the local AuthStore lookup. Pass None to disable.
Sourcepub fn oauth_validator(&self) -> Option<Arc<OAuthValidator>>
pub fn oauth_validator(&self) -> Option<Arc<OAuthValidator>>
Returns a clone of the configured OAuthValidator Arc, if any.
Hot path: called per HTTP request when an Authorization header
is present, so we hand back a cheap Arc clone.
Sourcepub fn check_write(&self, kind: WriteKind) -> Result<(), RedDBError>
pub fn check_write(&self, kind: WriteKind) -> Result<(), RedDBError>
Public-mutation gate snapshot (PLAN.md W1).
Surfaces that accept untrusted client requests (SQL DML/DDL,
gRPC mutating RPCs, HTTP/native wire mutations, admin
maintenance, serverless lifecycle) call check_write before
dispatching to storage. Returns RedDBError::ReadOnly on any
instance running as a replica or with options.read_only = true. The replica internal logical-WAL apply path reaches into
the store directly and never calls this method, so legitimate
replica catch-up still works.
Sourcepub fn write_gate(&self) -> &WriteGate
pub fn write_gate(&self) -> &WriteGate
Read-only handle to the gate, useful for transports that want to surface the policy in health/status output without taking on a dependency on the concrete enum.
Sourcepub fn lifecycle(&self) -> &Lifecycle
pub fn lifecycle(&self) -> &Lifecycle
Process lifecycle handle (PLAN.md Phase 1). Health probes, admin/shutdown, and signal handlers consult this single state machine.
Sourcepub fn resource_limits(&self) -> &ResourceLimits
pub fn resource_limits(&self) -> &ResourceLimits
Operator-imposed resource limits (PLAN.md Phase 4.1).
Sourcepub fn audit_log(&self) -> &AuditLogger
pub fn audit_log(&self) -> &AuditLogger
Append-only audit log for admin mutations (PLAN.md Phase 6.5).
Sourcepub fn audit_log_arc(&self) -> Arc<AuditLogger> ⓘ
pub fn audit_log_arc(&self) -> Arc<AuditLogger> ⓘ
Shared Arc to the audit logger — used by collaborators (the
lease lifecycle, future request-context plumbing) that need to
keep the logger alive past the runtime’s stack frame.
Sourcepub fn write_gate_arc(&self) -> Arc<WriteGate> ⓘ
pub fn write_gate_arc(&self) -> Arc<WriteGate> ⓘ
Shared Arc to the write gate. Same rationale as
audit_log_arc: collaborators (lease lifecycle, refresh
thread) need a clone-cheap handle they can move into a
background thread.
Sourcepub fn lease_lifecycle(&self) -> Option<&Arc<LeaseLifecycle>>
pub fn lease_lifecycle(&self) -> Option<&Arc<LeaseLifecycle>>
Serverless writer-lease state machine. None when the operator
did not opt into lease fencing (RED_LEASE_REQUIRED unset).
Sourcepub fn set_lease_lifecycle(
&self,
lifecycle: Arc<LeaseLifecycle>,
) -> Result<(), Arc<LeaseLifecycle>>
pub fn set_lease_lifecycle( &self, lifecycle: Arc<LeaseLifecycle>, ) -> Result<(), Arc<LeaseLifecycle>>
Install the lease lifecycle. Idempotent; subsequent calls return the previously stored value untouched.
Sourcepub fn check_batch_size(&self, requested: usize) -> Result<(), RedDBError>
pub fn check_batch_size(&self, requested: usize) -> Result<(), RedDBError>
Reject the call when the requested batch size exceeds
RED_MAX_BATCH_SIZE. Returns RedDBError::QuotaExceeded
shaped so the HTTP layer can map it to 413 Payload Too
Large (PLAN.md Phase 4.1).
Sourcepub fn check_db_size(&self) -> Result<(), RedDBError>
pub fn check_db_size(&self) -> Result<(), RedDBError>
Reject the call when the local DB file exceeds
RED_MAX_DB_SIZE_BYTES. Reads file metadata once per call —
the cost is a single stat() syscall, negligible against the
I/O the caller is about to do. Returns QuotaExceeded shaped
for HTTP 507 Insufficient Storage.
Sourcepub fn graceful_shutdown(
&self,
backup_on_shutdown: bool,
) -> Result<ShutdownReport, RedDBError>
pub fn graceful_shutdown( &self, backup_on_shutdown: bool, ) -> Result<ShutdownReport, RedDBError>
Graceful shutdown coordinator (PLAN.md Phase 1.1).
Steps, in order, all idempotent across re-entrant calls:
- Move lifecycle into
ShuttingDown(concurrent callers observeStoppedafter first finishes). - Flush WAL + run final checkpoint via
db.flush()so every acked write is durable on disk. - If
backup_on_shutdown == trueand a remote backend is configured, run a synchronoustrigger_backup()so the remote head reflects the final state. - Stamp the report and move to
Stopped. Subsequent calls return the cached report without re-running anything.
On any error, the runtime is still marked Stopped so the
process can exit; the caller logs the error context but does
not retry the same shutdown — the operator can inspect the
report fields to see which step failed.
pub fn cdc_emit( &self, operation: ChangeOperation, collection: &str, entity_id: u64, entity_kind: &str, ) -> u64
Sourcepub fn cdc_poll(&self, since_lsn: u64, max_count: usize) -> Vec<ChangeEvent>
pub fn cdc_poll(&self, since_lsn: u64, max_count: usize) -> Vec<ChangeEvent>
Poll CDC events since a given LSN.
Sourcepub fn cdc_current_lsn(&self) -> u64
pub fn cdc_current_lsn(&self) -> u64
PLAN.md Phase 11.4 — current CDC LSN. Public mutation
surfaces (HTTP query, gRPC entity ops) call this immediately
after a successful write to feed enforce_commit_policy.
pub fn kv_watch_events_since( &self, collection: &str, key: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
pub fn kv_watch_events_since_prefix( &self, collection: &str, prefix: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
Sourcepub fn backup_status(&self) -> BackupStatus
pub fn backup_status(&self) -> BackupStatus
Get backup scheduler status.
Sourcepub fn result_blob_cache(&self) -> &BlobCache
pub fn result_blob_cache(&self) -> &BlobCache
Borrow the runtime’s result Blob Cache.
Wired for the /admin/blob_cache/sweep and
/admin/blob_cache/flush_namespace HTTP handlers (issue #148
follow-up): both delegate to
crate::storage::cache::sweeper::BlobCacheSweeper, which takes a
&BlobCache. Also used by trigger_backup when
red.config.backup.include_blob_cache=true to locate the L2
directory for archival.
Sourcepub fn primary_replica_snapshots(&self) -> Vec<ReplicaState>
pub fn primary_replica_snapshots(&self) -> Vec<ReplicaState>
PLAN.md Phase 11.4 — owned snapshot of every registered replica’s state on this primary. Returns empty vec on non-primary instances or when no replicas are registered yet.
Sourcepub fn commit_policy(&self) -> CommitPolicy
pub fn commit_policy(&self) -> CommitPolicy
PLAN.md Phase 11.4 — active commit policy. Reads
RED_PRIMARY_COMMIT_POLICY once at runtime construction;
future env reloads will need a reload endpoint. Default is
Local — current behavior, no replica blocking.
Sourcepub fn replica_apply_error_counts(&self) -> [(ApplyErrorKind, u64); 4]
pub fn replica_apply_error_counts(&self) -> [(ApplyErrorKind, u64); 4]
PLAN.md Phase 11.5 — accessor for replica-side apply error
counters (gap / divergence / apply / decode). Returned
snapshot is consistent across the four counters; the labels
match reddb_replica_apply_errors_total{kind}.
Sourcepub fn quota_bucket(&self) -> &QuotaBucket
pub fn quota_bucket(&self) -> &QuotaBucket
PLAN.md Phase 4.4 — per-caller quota bucket. Always
returned; is_configured() lets callers short-circuit.
Sourcepub fn commit_waiter_snapshot(&self) -> Vec<(String, u64)>
pub fn commit_waiter_snapshot(&self) -> Vec<(String, u64)>
PLAN.md Phase 11.4 — observability snapshot of every replica’s durable LSN as known to the commit waiter. Empty vec on non-primary instances or when no replica has acked.
Sourcepub fn commit_waiter_metrics_snapshot(&self) -> (u64, u64, u64, u64)
pub fn commit_waiter_metrics_snapshot(&self) -> (u64, u64, u64, u64)
PLAN.md Phase 11.4 — (reached, timed_out, not_required, last_micros)
counters for /metrics. Always-zero on non-primary instances.
Sourcepub fn await_replica_acks(
&self,
target_lsn: u64,
count: u32,
timeout: Duration,
) -> AwaitOutcome
pub fn await_replica_acks( &self, target_lsn: u64, count: u32, timeout: Duration, ) -> AwaitOutcome
PLAN.md Phase 11.4 — block until at least count replicas
have durably applied through target_lsn, or timeout
elapses. Returns the AwaitOutcome so the caller can decide
whether to surface a timeout error to the client or continue
(the policy mapping lives in the commit dispatcher).
Foundation only — the write commit path doesn’t yet call
this. Wiring it is a per-surface task gated on the operator
flipping RED_PRIMARY_COMMIT_POLICY away from local.
Sourcepub fn enforce_commit_policy(
&self,
post_lsn: u64,
) -> Result<AwaitOutcome, RedDBError>
pub fn enforce_commit_policy( &self, post_lsn: u64, ) -> Result<AwaitOutcome, RedDBError>
PLAN.md Phase 11.4 — enforce the configured commit policy
against post_lsn (the LSN of the just-completed write).
Returns Ok(AwaitOutcome) on every successful enforcement
(including Reached and TimedOut when fail-on-timeout is
off). Returns Err(ReadOnly) only when:
- policy is
AckN(n)withn > 0 - the wait timed out
RED_COMMIT_FAIL_ON_TIMEOUT=trueis set
The HTTP / gRPC / wire surfaces map the error to 504 / wire backoff. Default behaviour (env unset) logs warn and returns success — matches PLAN.md “default v1 stays local” semantics while still letting the operator opt into hard-blocking.
Sourcepub fn encryption_at_rest_status(&self) -> (&'static str, Option<String>)
pub fn encryption_at_rest_status(&self) -> (&'static str, Option<String>)
PLAN.md Phase 6.3 — whether at-rest encryption is configured.
Reads RED_ENCRYPTION_KEY / RED_ENCRYPTION_KEY_FILE lazily;
returns ("enabled", None) when a key is loadable, ("error", Some(msg))
when the operator set the env but it doesn’t parse, and
("disabled", None) when no key is configured. The pager
hookup is deferred — this accessor surfaces the operator’s
intent for /admin/status without yet using the key in writes.
Sourcepub fn replica_apply_health(&self) -> Option<String>
pub fn replica_apply_health(&self) -> Option<String>
PLAN.md Phase 11.5 — current replica apply health label
(ok, gap, divergence, apply_error, connecting,
stalled_gap). Read from the persisted red.replication.state
config key updated by the replica loop. Returns None on
non-replica instances or when no apply has run yet.
Sourcepub fn wal_archive_progress(&self) -> (u64, u64)
pub fn wal_archive_progress(&self) -> (u64, u64)
Current local LSN paired with the LSN of the most recently
archived WAL segment. The difference is the replication /
archive lag operators alert on (PLAN.md Phase 5.1). Returns
(0, 0) when neither replication nor archiving is configured.
Sourcepub fn trigger_backup(&self) -> Result<BackupResult, RedDBError>
pub fn trigger_backup(&self) -> Result<BackupResult, RedDBError>
Trigger an immediate backup.
pub fn acquire(&self) -> Result<RuntimeConnection, RedDBError>
pub fn checkpoint(&self) -> Result<(), RedDBError>
pub fn run_maintenance(&self) -> Result<(), RedDBError>
pub fn scan_collection( &self, collection: &str, cursor: Option<ScanCursor>, limit: usize, ) -> Result<ScanPage, RedDBError>
pub fn catalog(&self) -> CatalogModelSnapshot
pub fn catalog_consistency_report(&self) -> CatalogConsistencyReport
pub fn catalog_attention_summary(&self) -> CatalogAttentionSummary
pub fn collection_attention(&self) -> Vec<CollectionDescriptor>
pub fn index_attention(&self) -> Vec<CatalogIndexStatus>
pub fn graph_projection_attention(&self) -> Vec<CatalogGraphProjectionStatus>
pub fn analytics_job_attention(&self) -> Vec<CatalogAnalyticsJobStatus>
pub fn stats(&self) -> RuntimeStats
Sourcepub fn execute_query_with_scope(
&self,
query: &str,
scope: ScopeOverride,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_query_with_scope( &self, query: &str, scope: ScopeOverride, ) -> Result<RuntimeQueryResult, RedDBError>
Execute a query under a typed scope override without embedding
the tenant / user / role values into the SQL string. Use this
from transport middleware (HTTP / gRPC / worker loops) where the
scope is resolved from auth claims and the SQL is a parameterised
template — avoids the string-concat injection risk of building
WITHIN TENANT '<id>' … manually, and is drop-in compatible with
prepared statements that didn’t know about tenancy.
Precedence matches the WITHIN clause: the passed scope
overrides SET LOCAL TENANT, which overrides SET TENANT.
The override is pushed on the thread-local scope stack for the
duration of the call and popped on return — pool-shared
connections cannot leak it across requests.
Sourcepub fn execute_query(
&self,
query: &str,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_query( &self, query: &str, ) -> Result<RuntimeQueryResult, RedDBError>
Issue #205 — single lifecycle exit for slow-query logging.
execute_query_inner does the real work; this wrapper times it
and, if elapsed exceeds the configured threshold, hands the
triple (QueryKind, elapsed_ms, sql_redacted, scope) to the
SlowQueryLogger. The threshold + sample_pct were captured at
SlowQueryLogger construction (runtime startup), so the per-call
cost on below-threshold paths is one relaxed atomic load.
pub fn result_cache_shadow_divergences(&self) -> u64
Sourcepub fn invalidate_result_cache(&self)
pub fn invalidate_result_cache(&self)
Invalidate the result cache (call after any write operation). Full clear — use for DDL (DROP TABLE, schema changes) or when table is unknown.
Sourcepub fn ddl_epoch(&self) -> u64
pub fn ddl_epoch(&self) -> u64
Read the monotonic DDL epoch counter. Bumped by every
invalidate_plan_cache call so prepared-statement holders can
detect schema drift between PREPARE and EXECUTE.
Sourcepub fn register_tenant_table(&self, table: &str, column: &str)
pub fn register_tenant_table(&self, table: &str, column: &str)
Register a table as tenant-scoped (Phase 2.5.4). Installs the
in-memory column mapping, the implicit RLS policy, and enables
row-level security on the table. Idempotent — re-registering
the same (table, column) replaces the prior auto-policy.
Sourcepub fn tenant_column(&self, table: &str) -> Option<String>
pub fn tenant_column(&self, table: &str) -> Option<String>
Retrieve the tenant column for a table, if any (Phase 2.5.4).
Used by the INSERT auto-fill path to know which column to
populate with current_tenant() when the user didn’t name it.
Sourcepub fn unregister_tenant_table(&self, table: &str)
pub fn unregister_tenant_table(&self, table: &str)
Remove a table’s tenant registration (Phase 2.5.4). Called by DROP TABLE / ALTER TABLE DISABLE TENANCY. Removes the auto-policy but leaves any user-installed explicit policies intact.
Sourcepub fn current_snapshot(&self) -> Snapshot
pub fn current_snapshot(&self) -> Snapshot
Return the snapshot the current connection should use for visibility checks (Phase 2.3 PG parity).
- If the connection is inside a BEGIN-wrapped transaction, reuse
the snapshot stored in its
TxnContext. - Otherwise (autocommit), capture a fresh snapshot tied to an implicit xid=0 — the read path treats pre-MVCC rows as always visible so this degrades to “see everything committed”.
Sourcepub fn current_xid(&self) -> Option<u64>
pub fn current_xid(&self) -> Option<u64>
Xid of the current connection’s active transaction, or None when
running outside a BEGIN/COMMIT block. Write paths call this to
decide whether to stamp xmin/xmax on tuples.
Phase 2.3.2e: when a savepoint is open, writer_xid returns the
sub-xid so new writes can be selectively rolled back. Otherwise
the parent txn’s xid is returned, matching pre-savepoint
behaviour. Callers that need the enclosing transaction xid
(e.g. VACUUM min-active calculations) should read ctx.xid
directly.
Sourcepub fn snapshot_manager(&self) -> Arc<SnapshotManager> ⓘ
pub fn snapshot_manager(&self) -> Arc<SnapshotManager> ⓘ
Access the shared SnapshotManager — useful for VACUUM to compute
the oldest-active xid when reclaiming dead tuples.
Sourcepub fn current_txn_own_xids(&self) -> HashSet<u64>
pub fn current_txn_own_xids(&self) -> HashSet<u64>
Own-tx xids (parent + open savepoints) for the current
connection. Transports + tests that build a SnapshotContext
manually (outside the execute_query scope) need this set so
the writer’s own uncommitted tuples stay visible to self.
Sourcepub fn foreign_tables(&self) -> Arc<ForeignTableRegistry> ⓘ
pub fn foreign_tables(&self) -> Arc<ForeignTableRegistry> ⓘ
Access the shared ForeignTableRegistry (Phase 3.2 PG parity).
Callers use this to check whether a table name is a registered
foreign table (registry.is_foreign_table(name)) and, if so, to
scan it (registry.scan(name)). The read-path rewriter consults
this before dispatching into native-collection lookup.
Sourcepub fn is_rls_enabled(&self, table: &str) -> bool
pub fn is_rls_enabled(&self, table: &str) -> bool
Is Row-Level Security enabled for this table? (Phase 2.5 PG parity)
Sourcepub fn matching_rls_policies(
&self,
table: &str,
role: Option<&str>,
action: PolicyAction,
) -> Vec<Filter>
pub fn matching_rls_policies( &self, table: &str, role: Option<&str>, action: PolicyAction, ) -> Vec<Filter>
Collect the USING predicates that apply to this (table, role, action).
Returned filters should be OR-combined (a row passes RLS when any matching policy accepts it) and then AND-ed into the query’s WHERE. When the table has RLS disabled this returns an empty Vec — callers can fast-path back to the unfiltered read.
Sourcepub fn matching_rls_policies_for_kind(
&self,
table: &str,
role: Option<&str>,
action: PolicyAction,
kind: PolicyTargetKind,
) -> Vec<Filter>
pub fn matching_rls_policies_for_kind( &self, table: &str, role: Option<&str>, action: PolicyAction, kind: PolicyTargetKind, ) -> Vec<Filter>
Kind-aware variant used by cross-model scans (Phase 2.5.5).
Graph scans request Nodes / Edges, vector ANN requests
Vectors, queue consumers request Messages, and timeseries
range scans request Points. Policies tagged with a
different kind are skipped so a graph-scoped policy doesn’t
accidentally gate a table SELECT on the same collection.
Source§impl RedDBRuntime
impl RedDBRuntime
Sourcepub fn execute_create_table(
&self,
raw_query: &str,
query: &CreateTableQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_create_table( &self, raw_query: &str, query: &CreateTableQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute CREATE TABLE
Creates a new collection in the store. Column definitions are recorded for introspection but do not enforce rigid schema constraints.
Sourcepub fn execute_drop_table(
&self,
raw_query: &str,
query: &DropTableQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_table( &self, raw_query: &str, query: &DropTableQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute DROP TABLE
Drops the collection and all its data from the store.
pub fn execute_drop_graph( &self, raw_query: &str, query: &DropGraphQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_vector( &self, raw_query: &str, query: &DropVectorQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_document( &self, raw_query: &str, query: &DropDocumentQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_kv( &self, raw_query: &str, query: &DropKvQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_collection( &self, raw_query: &str, query: &DropCollectionQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Sourcepub fn execute_alter_table(
&self,
raw_query: &str,
query: &AlterTableQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_alter_table( &self, raw_query: &str, query: &AlterTableQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute ALTER TABLE
In RedDB’s schema-on-read model, ALTER TABLE operations are advisory. ADD COLUMN records the schema intent, DROP COLUMN removes it, and RENAME COLUMN is a metadata rename. Existing data is not rewritten.
Sourcepub fn execute_explain_alter(
&self,
raw_query: &str,
query: &ExplainAlterQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_explain_alter( &self, raw_query: &str, query: &ExplainAlterQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute EXPLAIN ALTER FOR CREATE TABLE
Pure read: computes the schema diff between the target table’s
current CollectionContract and the embedded CREATE TABLE body,
and returns it as SQL ALTER TABLE text (default) or structured
JSON. Never mutates storage.
Sourcepub fn execute_create_index(
&self,
raw_query: &str,
query: &CreateIndexQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_create_index( &self, raw_query: &str, query: &CreateIndexQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute CREATE INDEX
Registers a new index on a collection, builds it from existing data, and makes it available to the query executor for O(1) lookups.
Sourcepub fn execute_drop_index(
&self,
raw_query: &str,
query: &DropIndexQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_index( &self, raw_query: &str, query: &DropIndexQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute DROP INDEX
Removes an index from a collection.
pub fn execute_truncate( &self, raw_query: &str, query: &TruncateQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
Sourcepub fn execute_insert(
&self,
raw_query: &str,
query: &InsertQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_insert( &self, raw_query: &str, query: &InsertQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute INSERT INTO table [entity_type] (cols) VALUES (vals), …
Each row in query.values is zipped with query.columns to produce a
set of named fields, which is then dispatched based on entity_type.
Sourcepub fn execute_update(
&self,
raw_query: &str,
query: &UpdateQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_update( &self, raw_query: &str, query: &UpdateQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute UPDATE table SET col=val, … WHERE filter
Scans the target collection, evaluates the WHERE filter against each record, and patches every matching entity.
Sourcepub fn execute_delete(
&self,
raw_query: &str,
query: &DeleteQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_delete( &self, raw_query: &str, query: &DeleteQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute DELETE FROM table WHERE filter
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn ec_add( &self, collection: &str, field: &str, target_id: u64, value: f64, source: Option<&str>, ) -> Result<u64, RedDBError>
pub fn ec_sub( &self, collection: &str, field: &str, target_id: u64, value: f64, source: Option<&str>, ) -> Result<u64, RedDBError>
pub fn ec_set( &self, collection: &str, field: &str, target_id: u64, value: f64, source: Option<&str>, ) -> Result<u64, RedDBError>
pub fn ec_consolidate( &self, collection: &str, field: &str, target_id: Option<u64>, ) -> Result<ConsolidationResult, RedDBError>
pub fn ec_status( &self, collection: &str, field: &str, target_id: u64, ) -> EcStatus
pub fn ec_register_field(&self, config: EcFieldConfig)
pub fn ec_global_status(&self) -> Vec<EcStatus>
Sourcepub fn ec_shutdown(&self) -> Result<u64, RedDBError>
pub fn ec_shutdown(&self) -> Result<u64, RedDBError>
Graceful EC shutdown: consolidate all pending, stop worker, flush. Call during serverless reclaim or application shutdown.
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_events_backfill( &self, raw_query: &str, query: &EventsBackfillQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn graph_neighborhood( &self, node: &str, direction: RuntimeGraphDirection, max_depth: usize, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphNeighborhoodResult, RedDBError>
pub fn graph_traverse( &self, source: &str, direction: RuntimeGraphDirection, max_depth: usize, strategy: RuntimeGraphTraversalStrategy, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphTraversalResult, RedDBError>
pub fn graph_shortest_path( &self, source: &str, target: &str, direction: RuntimeGraphDirection, algorithm: RuntimeGraphPathAlgorithm, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphPathResult, RedDBError>
pub fn graph_components( &self, mode: RuntimeGraphComponentsMode, min_size: usize, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphComponentsResult, RedDBError>
pub fn graph_centrality( &self, algorithm: RuntimeGraphCentralityAlgorithm, top_k: usize, normalize: bool, max_iterations: Option<usize>, epsilon: Option<f64>, alpha: Option<f64>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCentralityResult, RedDBError>
pub fn graph_communities( &self, algorithm: RuntimeGraphCommunityAlgorithm, min_size: usize, max_iterations: Option<usize>, resolution: Option<f64>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCommunityResult, RedDBError>
pub fn graph_clustering( &self, top_k: usize, include_triangles: bool, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphClusteringResult, RedDBError>
pub fn graph_personalized_pagerank( &self, seeds: Vec<String>, top_k: usize, alpha: Option<f64>, epsilon: Option<f64>, max_iterations: Option<usize>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCentralityResult, RedDBError>
pub fn graph_hits( &self, top_k: usize, epsilon: Option<f64>, max_iterations: Option<usize>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphHitsResult, RedDBError>
pub fn graph_cycles( &self, max_length: usize, max_cycles: usize, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCyclesResult, RedDBError>
pub fn graph_topological_sort( &self, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphTopologicalSortResult, RedDBError>
pub fn graph_properties( &self, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphPropertiesResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
Sourcepub fn execute_graph_command(
&self,
raw_query: &str,
cmd: &GraphCommand,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_graph_command( &self, raw_query: &str, cmd: &GraphCommand, ) -> Result<RuntimeQueryResult, RedDBError>
Execute a GRAPH analytics command.
Sourcepub fn execute_search_command(
&self,
raw_query: &str,
cmd: &SearchCommand,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_search_command( &self, raw_query: &str, cmd: &SearchCommand, ) -> Result<RuntimeQueryResult, RedDBError>
Execute a SEARCH command.
Source§impl RedDBRuntime
impl RedDBRuntime
Sourcepub fn execute_kv_command(
&self,
raw_query: &str,
cmd: &KvCommand,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_kv_command( &self, raw_query: &str, cmd: &KvCommand, ) -> Result<RuntimeQueryResult, RedDBError>
Dispatch a KV PUT / GET / DELETE command.
pub fn vault_watch_events_since( &self, collection: &str, key: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
pub fn vault_watch_events_since_prefix( &self, collection: &str, prefix: &str, since_lsn: u64, max_count: usize, ) -> Vec<KvWatchEvent>
Source§impl RedDBRuntime
impl RedDBRuntime
Sourcepub fn execute_create_migration(
&self,
raw_query: &str,
q: &CreateMigrationQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_create_migration( &self, raw_query: &str, q: &CreateMigrationQuery, ) -> Result<RuntimeQueryResult, RedDBError>
CREATE MIGRATION — register a migration definition with status=pending.
Sourcepub fn execute_apply_migration(
&self,
raw_query: &str,
q: &ApplyMigrationQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_apply_migration( &self, raw_query: &str, q: &ApplyMigrationQuery, ) -> Result<RuntimeQueryResult, RedDBError>
APPLY MIGRATION name [FOR TENANT id] | APPLY MIGRATION * [FOR TENANT id]
Sourcepub fn execute_rollback_migration(
&self,
raw_query: &str,
q: &RollbackMigrationQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_rollback_migration( &self, raw_query: &str, q: &RollbackMigrationQuery, ) -> Result<RuntimeQueryResult, RedDBError>
ROLLBACK MIGRATION name
Sourcepub fn execute_explain_migration(
&self,
raw_query: &str,
q: &ExplainMigrationQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_explain_migration( &self, raw_query: &str, q: &ExplainMigrationQuery, ) -> Result<RuntimeQueryResult, RedDBError>
EXPLAIN MIGRATION name
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn snapshots(&self) -> Result<Vec<SnapshotDescriptor>, RedDBError>
pub fn create_snapshot(&self) -> Result<SnapshotDescriptor, RedDBError>
pub fn exports(&self) -> Result<Vec<ExportDescriptor>, RedDBError>
pub fn native_header(&self) -> Result<PhysicalFileHeader, RedDBError>
pub fn native_collection_roots( &self, ) -> Result<BTreeMap<String, u64>, RedDBError>
pub fn native_manifest_summary( &self, ) -> Result<NativeManifestSummary, RedDBError>
pub fn native_registry_summary( &self, ) -> Result<NativeRegistrySummary, RedDBError>
pub fn native_recovery_summary( &self, ) -> Result<NativeRecoverySummary, RedDBError>
pub fn native_catalog_summary(&self) -> Result<NativeCatalogSummary, RedDBError>
pub fn native_physical_state(&self) -> Result<NativePhysicalState, RedDBError>
pub fn native_vector_artifact_pages( &self, ) -> Result<Vec<NativeVectorArtifactPageSummary>, RedDBError>
pub fn inspect_native_vector_artifact( &self, collection: &str, artifact_kind: Option<&str>, ) -> Result<NativeVectorArtifactInspection, RedDBError>
pub fn warmup_native_vector_artifact( &self, collection: &str, artifact_kind: Option<&str>, ) -> Result<NativeVectorArtifactInspection, RedDBError>
pub fn inspect_native_vector_artifacts( &self, ) -> Result<NativeVectorArtifactBatchInspection, RedDBError>
pub fn warmup_native_vector_artifacts( &self, ) -> Result<NativeVectorArtifactBatchInspection, RedDBError>
pub fn native_header_repair_policy(&self) -> Result<String, RedDBError>
pub fn repair_native_header_from_metadata(&self) -> Result<String, RedDBError>
pub fn rebuild_physical_metadata_from_native_state( &self, ) -> Result<bool, RedDBError>
pub fn repair_native_physical_state_from_metadata( &self, ) -> Result<bool, RedDBError>
pub fn native_metadata_state_summary( &self, ) -> Result<NativeMetadataStateSummary, RedDBError>
pub fn readiness_for_query(&self) -> bool
pub fn readiness_for_query_serverless(&self) -> bool
pub fn readiness_for_write(&self) -> bool
pub fn readiness_for_write_serverless(&self) -> bool
pub fn readiness_for_repair(&self) -> bool
pub fn readiness_for_repair_serverless(&self) -> bool
pub fn manifest_events(&self) -> Result<Vec<ManifestEvent>, RedDBError>
pub fn manifest_events_filtered( &self, collection: Option<&str>, kind: Option<&str>, since_snapshot: Option<u64>, ) -> Result<Vec<ManifestEvent>, RedDBError>
pub fn collection_roots(&self) -> Result<BTreeMap<String, u64>, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn create_export( &self, name: impl Into<String>, ) -> Result<ExportDescriptor, RedDBError>
pub fn graph_projections( &self, ) -> Result<Vec<PhysicalGraphProjection>, RedDBError>
pub fn operational_graph_projections(&self) -> Vec<PhysicalGraphProjection>
pub fn graph_projection_named( &self, name: &str, ) -> Result<RuntimeGraphProjection, RedDBError>
pub fn save_graph_projection( &self, name: impl Into<String>, projection: RuntimeGraphProjection, source: Option<String>, ) -> Result<PhysicalGraphProjection, RedDBError>
pub fn materialize_graph_projection( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
pub fn mark_graph_projection_materializing( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
pub fn fail_graph_projection( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
pub fn mark_graph_projection_stale( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
pub fn analytics_jobs(&self) -> Result<Vec<PhysicalAnalyticsJob>, RedDBError>
pub fn operational_analytics_jobs(&self) -> Vec<PhysicalAnalyticsJob>
pub fn save_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn start_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn queue_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn fail_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn mark_analytics_job_stale( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn complete_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn record_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
pub fn resolve_graph_projection( &self, projection_name: Option<&str>, inline: Option<RuntimeGraphProjection>, ) -> Result<Option<RuntimeGraphProjection>, RedDBError>
pub fn apply_retention_policy(&self) -> Result<(), RedDBError>
pub fn indexes(&self) -> Vec<PhysicalIndexState>
pub fn declared_indexes(&self) -> Vec<PhysicalIndexState>
pub fn declared_indexes_for_collection( &self, collection: &str, ) -> Vec<PhysicalIndexState>
pub fn index_statuses(&self) -> Vec<CatalogIndexStatus>
pub fn graph_projection_statuses(&self) -> Vec<CatalogGraphProjectionStatus>
pub fn analytics_job_statuses(&self) -> Vec<CatalogAnalyticsJobStatus>
pub fn indexes_for_collection( &self, collection: &str, ) -> Vec<PhysicalIndexState>
pub fn set_index_enabled( &self, name: &str, enabled: bool, ) -> Result<PhysicalIndexState, RedDBError>
pub fn mark_index_building( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
pub fn fail_index(&self, name: &str) -> Result<PhysicalIndexState, RedDBError>
pub fn mark_index_stale( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
pub fn mark_index_ready( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
pub fn warmup_index_with_lifecycle( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
pub fn warmup_index(&self, name: &str) -> Result<PhysicalIndexState, RedDBError>
pub fn rebuild_indexes( &self, collection: Option<&str>, ) -> Result<Vec<PhysicalIndexState>, RedDBError>
pub fn rebuild_indexes_with_lifecycle( &self, collection: Option<&str>, ) -> Result<Vec<PhysicalIndexState>, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_probabilistic_command( &self, raw_query: &str, cmd: &ProbabilisticCommand, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_create_queue( &self, raw_query: &str, query: &CreateQueueQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_alter_queue( &self, raw_query: &str, query: &AlterQueueQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_queue( &self, raw_query: &str, query: &DropQueueQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_queue_command( &self, raw_query: &str, cmd: &QueueCommand, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_queue_select( &self, raw_query: &str, query: &QueueSelectQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn explain_query( &self, query: &str, ) -> Result<RuntimeQueryExplain, RedDBError>
pub fn search_similar( &self, collection: &str, vector: &[f32], k: usize, min_score: f32, ) -> Result<Vec<SimilarResult>, RedDBError>
pub fn search_ivf( &self, collection: &str, vector: &[f32], k: usize, n_lists: usize, n_probes: Option<usize>, ) -> Result<RuntimeIvfSearchResult, RedDBError>
pub fn search_hybrid( &self, vector: Option<Vec<f32>>, query: Option<String>, k: Option<usize>, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, graph_pattern: Option<RuntimeGraphPattern>, filters: Vec<RuntimeFilter>, weights: Option<RuntimeQueryWeights>, min_score: Option<f32>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
pub fn search_multimodal( &self, query: String, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
pub fn search_index( &self, index: String, value: String, exact: bool, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
pub fn search_text( &self, query: String, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, fields: Option<Vec<String>>, limit: Option<usize>, fuzzy: bool, ) -> Result<QueryResult, RedDBError>
pub fn search_context( &self, input: SearchContextInput, ) -> Result<ContextSearchResult, RedDBError>
Sourcepub fn execute_ask(
&self,
raw_query: &str,
ask: &AskQuery,
) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_ask( &self, raw_query: &str, ask: &AskQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Execute an ASK query: AskPipeline funnel + LLM synthesis.
Issue #121: replaces the single broad search_context call with
the four-stage AskPipeline::execute funnel
(extract_tokens → match_schema → vector_search_scoped →
filter_values). Prompt rendering goes through
crate::runtime::ai::prompt_template::PromptTemplate so the
caller question, schema-vocabulary candidates, and Stage 4 rows
are slot-typed (issue #122 follow-up): injection detection runs
on tenant-derived content, secrets are redacted before reaching
the LLM, and the rendered messages can be peeled per provider
tier downstream when richer drivers land.
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_create_timeseries( &self, raw_query: &str, query: &CreateTimeSeriesQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_timeseries( &self, raw_query: &str, query: &DropTimeSeriesQuery, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn execute_create_tree( &self, raw_query: &str, query: &CreateTreeQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_drop_tree( &self, raw_query: &str, query: &DropTreeQuery, ) -> Result<RuntimeQueryResult, RedDBError>
pub fn execute_tree_command( &self, raw_query: &str, command: &TreeCommand, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RedDBRuntime
impl RedDBRuntime
pub fn vcs_commit(&self, input: CreateCommitInput) -> Result<Commit, RedDBError>
pub fn vcs_branch_create( &self, input: CreateBranchInput, ) -> Result<Ref, RedDBError>
pub fn vcs_branch_delete(&self, name: &str) -> Result<(), RedDBError>
pub fn vcs_tag_create(&self, input: CreateTagInput) -> Result<Ref, RedDBError>
pub fn vcs_list_refs( &self, prefix: Option<&str>, ) -> Result<Vec<Ref>, RedDBError>
pub fn vcs_checkout(&self, input: CheckoutInput) -> Result<Ref, RedDBError>
pub fn vcs_merge(&self, input: MergeInput) -> Result<MergeOutcome, RedDBError>
pub fn vcs_cherry_pick( &self, connection_id: u64, commit: &str, author: Author, ) -> Result<MergeOutcome, RedDBError>
pub fn vcs_revert( &self, connection_id: u64, commit: &str, author: Author, ) -> Result<Commit, RedDBError>
pub fn vcs_reset(&self, input: ResetInput) -> Result<(), RedDBError>
pub fn vcs_log(&self, input: LogInput) -> Result<Vec<Commit>, RedDBError>
pub fn vcs_diff(&self, input: DiffInput) -> Result<Diff, RedDBError>
pub fn vcs_status(&self, input: StatusInput) -> Result<Status, RedDBError>
pub fn vcs_lca(&self, a: &str, b: &str) -> Result<Option<String>, RedDBError>
pub fn vcs_conflicts_list( &self, merge_state_id: &str, ) -> Result<Vec<Conflict>, RedDBError>
pub fn vcs_conflict_resolve( &self, conflict_id: &str, _resolved: Value, ) -> Result<(), RedDBError>
pub fn vcs_resolve_as_of(&self, spec: AsOfSpec) -> Result<u64, RedDBError>
pub fn vcs_set_versioned( &self, collection: &str, enabled: bool, ) -> Result<(), RedDBError>
pub fn vcs_list_versioned(&self) -> Result<Vec<String>, RedDBError>
pub fn vcs_is_versioned(&self, collection: &str) -> Result<bool, RedDBError>
pub fn vcs_resolve_commitish(&self, spec: &str) -> Result<String, RedDBError>
Trait Implementations§
Source§impl Clone for RedDBRuntime
impl Clone for RedDBRuntime
Source§fn clone(&self) -> RedDBRuntime
fn clone(&self) -> RedDBRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl HealthProvider for RedDBRuntime
impl HealthProvider for RedDBRuntime
fn health(&self) -> HealthReport
Source§impl RuntimeAdminPort for RedDBRuntime
impl RuntimeAdminPort for RedDBRuntime
fn set_index_enabled( &self, name: &str, enabled: bool, ) -> Result<PhysicalIndexState, RedDBError>
fn mark_index_building( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
fn fail_index(&self, name: &str) -> Result<PhysicalIndexState, RedDBError>
fn mark_index_stale(&self, name: &str) -> Result<PhysicalIndexState, RedDBError>
fn mark_index_ready(&self, name: &str) -> Result<PhysicalIndexState, RedDBError>
fn warmup_index_with_lifecycle( &self, name: &str, ) -> Result<PhysicalIndexState, RedDBError>
fn rebuild_indexes_with_lifecycle( &self, collection: Option<&str>, ) -> Result<Vec<PhysicalIndexState>, RedDBError>
fn save_graph_projection( &self, name: impl Into<String>, projection: RuntimeGraphProjection, source: Option<String>, ) -> Result<PhysicalGraphProjection, RedDBError>
fn mark_graph_projection_materializing( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
fn materialize_graph_projection( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
fn fail_graph_projection( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
fn mark_graph_projection_stale( &self, name: &str, ) -> Result<PhysicalGraphProjection, RedDBError>
fn save_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
fn start_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
fn queue_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
fn fail_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
fn mark_analytics_job_stale( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
fn complete_analytics_job( &self, kind: impl Into<String>, projection_name: Option<String>, metadata: BTreeMap<String, String>, ) -> Result<PhysicalAnalyticsJob, RedDBError>
Source§impl RuntimeCatalogPort for RedDBRuntime
impl RuntimeCatalogPort for RedDBRuntime
fn collections(&self) -> Vec<String>
fn catalog(&self) -> CatalogModelSnapshot
fn catalog_consistency_report(&self) -> CatalogConsistencyReport
fn catalog_attention_summary(&self) -> CatalogAttentionSummary
fn collection_attention(&self) -> Vec<CollectionDescriptor>
fn indexes(&self) -> Vec<PhysicalIndexState>
fn declared_indexes(&self) -> Vec<PhysicalIndexState>
fn indexes_for_collection(&self, collection: &str) -> Vec<PhysicalIndexState>
fn declared_indexes_for_collection( &self, collection: &str, ) -> Vec<PhysicalIndexState>
fn index_statuses(&self) -> Vec<CatalogIndexStatus>
fn index_attention(&self) -> Vec<CatalogIndexStatus>
fn graph_projections(&self) -> Result<Vec<PhysicalGraphProjection>, RedDBError>
fn operational_graph_projections(&self) -> Vec<PhysicalGraphProjection>
fn graph_projection_statuses(&self) -> Vec<CatalogGraphProjectionStatus>
fn graph_projection_attention(&self) -> Vec<CatalogGraphProjectionStatus>
fn analytics_jobs(&self) -> Result<Vec<PhysicalAnalyticsJob>, RedDBError>
fn operational_analytics_jobs(&self) -> Vec<PhysicalAnalyticsJob>
fn analytics_job_statuses(&self) -> Vec<CatalogAnalyticsJobStatus>
fn analytics_job_attention(&self) -> Vec<CatalogAnalyticsJobStatus>
fn stats(&self) -> RuntimeStats
Source§impl RuntimeEntityPort for RedDBRuntime
impl RuntimeEntityPort for RedDBRuntime
fn create_row( &self, input: CreateRowInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_rows_batch( &self, input: CreateRowsBatchInput, ) -> Result<Vec<CreateEntityOutput>, RedDBError>
Source§fn create_rows_batch_prevalidated_columnar(
&self,
collection: String,
column_names: Arc<Vec<String>>,
rows: Vec<Vec<Value>>,
) -> Result<usize, RedDBError>
fn create_rows_batch_prevalidated_columnar( &self, collection: String, column_names: Arc<Vec<String>>, rows: Vec<Vec<Value>>, ) -> Result<usize, RedDBError>
Vec<Vec<Value>> + a shared column-
name vector, no per-cell (String, Value) tuples allocated.
Avoids ~N×ncols String clones vs the tuple path. The schema
is shared across every row as a single Arc<Vec<String>>.Source§fn create_rows_batch_columnar(
&self,
collection: String,
column_names: Arc<Vec<String>>,
rows: Vec<Vec<Value>>,
) -> Result<usize, RedDBError>
fn create_rows_batch_columnar( &self, collection: String, column_names: Arc<Vec<String>>, rows: Vec<Vec<Value>>, ) -> Result<usize, RedDBError>
Arc<Vec<String>> schema shared across
every row, Vec<Vec<Value>> row payload). Equivalent to
create_rows_batch semantically but skips the per-row
(String, Value) tuple materialisation in the wire decoder.
When the collection has no contract (or no declared columns)
fast-paths to create_rows_batch_prevalidated_columnar;
otherwise falls back to the tuple path so contract
normalisation can run.Source§fn create_rows_batch_prevalidated(
&self,
input: CreateRowsBatchInput,
) -> Result<usize, RedDBError>
fn create_rows_batch_prevalidated( &self, input: CreateRowsBatchInput, ) -> Result<usize, RedDBError>
normalize_row_fields_for_contract, enforce_row_uniqueness,
and enforce_row_batch_uniqueness. Returns the row count.
Used by MSG_BULK_INSERT_PREVALIDATED.fn create_node( &self, input: CreateNodeInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_edge( &self, input: CreateEdgeInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_vector( &self, input: CreateVectorInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_document( &self, input: CreateDocumentInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_kv( &self, input: CreateKvInput, ) -> Result<CreateEntityOutput, RedDBError>
fn create_timeseries_point( &self, input: CreateTimeSeriesPointInput, ) -> Result<CreateEntityOutput, RedDBError>
fn get_kv( &self, collection: &str, key: &str, ) -> Result<Option<(Value, EntityId)>, RedDBError>
fn delete_kv(&self, collection: &str, key: &str) -> Result<bool, RedDBError>
fn patch_entity( &self, input: PatchEntityInput, ) -> Result<CreateEntityOutput, RedDBError>
fn delete_entity( &self, input: DeleteEntityInput, ) -> Result<DeleteEntityOutput, RedDBError>
Source§impl RuntimeGraphPort for RedDBRuntime
impl RuntimeGraphPort for RedDBRuntime
fn resolve_graph_projection( &self, name: Option<&str>, inline: Option<RuntimeGraphProjection>, ) -> Result<Option<RuntimeGraphProjection>, RedDBError>
fn graph_neighborhood( &self, node: &str, direction: RuntimeGraphDirection, max_depth: usize, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphNeighborhoodResult, RedDBError>
fn graph_traverse( &self, source: &str, direction: RuntimeGraphDirection, max_depth: usize, strategy: RuntimeGraphTraversalStrategy, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphTraversalResult, RedDBError>
fn graph_shortest_path( &self, source: &str, target: &str, direction: RuntimeGraphDirection, algorithm: RuntimeGraphPathAlgorithm, edge_labels: Option<Vec<String>>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphPathResult, RedDBError>
fn graph_components( &self, mode: RuntimeGraphComponentsMode, min_size: usize, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphComponentsResult, RedDBError>
fn graph_centrality( &self, algorithm: RuntimeGraphCentralityAlgorithm, top_k: usize, normalize: bool, max_iterations: Option<usize>, epsilon: Option<f64>, alpha: Option<f64>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCentralityResult, RedDBError>
fn graph_communities( &self, algorithm: RuntimeGraphCommunityAlgorithm, min_size: usize, max_iterations: Option<usize>, resolution: Option<f64>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCommunityResult, RedDBError>
fn graph_clustering( &self, top_k: usize, include_triangles: bool, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphClusteringResult, RedDBError>
fn graph_personalized_pagerank( &self, seeds: Vec<String>, top_k: usize, alpha: Option<f64>, epsilon: Option<f64>, max_iterations: Option<usize>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCentralityResult, RedDBError>
fn graph_hits( &self, top_k: usize, epsilon: Option<f64>, max_iterations: Option<usize>, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphHitsResult, RedDBError>
fn graph_cycles( &self, max_length: usize, max_cycles: usize, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphCyclesResult, RedDBError>
fn graph_topological_sort( &self, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphTopologicalSortResult, RedDBError>
fn graph_properties( &self, projection: Option<RuntimeGraphProjection>, ) -> Result<RuntimeGraphPropertiesResult, RedDBError>
Source§impl RuntimeNativePort for RedDBRuntime
impl RuntimeNativePort for RedDBRuntime
fn health_report(&self) -> HealthReport
fn collection_roots(&self) -> Result<BTreeMap<String, u64>, RedDBError>
fn snapshots(&self) -> Result<Vec<SnapshotDescriptor>, RedDBError>
fn exports(&self) -> Result<Vec<ExportDescriptor>, RedDBError>
fn physical_metadata(&self) -> Result<PhysicalMetadataFile, RedDBError>
fn manifest_events_filtered( &self, collection: Option<&str>, kind: Option<&str>, since_snapshot: Option<u64>, ) -> Result<Vec<ManifestEvent>, RedDBError>
fn create_snapshot(&self) -> Result<SnapshotDescriptor, RedDBError>
fn create_export(&self, name: String) -> Result<ExportDescriptor, RedDBError>
fn checkpoint(&self) -> Result<(), RedDBError>
fn apply_retention_policy(&self) -> Result<(), RedDBError>
fn run_maintenance(&self) -> Result<(), RedDBError>
fn native_header(&self) -> Result<PhysicalFileHeader, RedDBError>
fn native_collection_roots(&self) -> Result<BTreeMap<String, u64>, RedDBError>
fn native_manifest_summary(&self) -> Result<NativeManifestSummary, RedDBError>
fn native_registry_summary(&self) -> Result<NativeRegistrySummary, RedDBError>
fn native_recovery_summary(&self) -> Result<NativeRecoverySummary, RedDBError>
fn native_catalog_summary(&self) -> Result<NativeCatalogSummary, RedDBError>
fn native_physical_state(&self) -> Result<NativePhysicalState, RedDBError>
fn native_vector_artifact_pages( &self, ) -> Result<Vec<NativeVectorArtifactPageSummary>, RedDBError>
fn inspect_native_vector_artifact( &self, collection: &str, artifact_kind: Option<&str>, ) -> Result<NativeVectorArtifactInspection, RedDBError>
fn warmup_native_vector_artifact( &self, collection: &str, artifact_kind: Option<&str>, ) -> Result<NativeVectorArtifactInspection, RedDBError>
fn inspect_native_vector_artifacts( &self, ) -> Result<NativeVectorArtifactBatchInspection, RedDBError>
fn warmup_native_vector_artifacts( &self, ) -> Result<NativeVectorArtifactBatchInspection, RedDBError>
fn native_header_repair_policy(&self) -> Result<String, RedDBError>
fn repair_native_header_from_metadata(&self) -> Result<String, RedDBError>
fn rebuild_physical_metadata_from_native_state( &self, ) -> Result<bool, RedDBError>
fn repair_native_physical_state_from_metadata(&self) -> Result<bool, RedDBError>
fn native_metadata_state_summary( &self, ) -> Result<NativeMetadataStateSummary, RedDBError>
fn readiness_for_query(&self) -> bool
fn readiness_for_query_serverless(&self) -> bool
fn readiness_for_write(&self) -> bool
fn readiness_for_write_serverless(&self) -> bool
fn readiness_for_repair(&self) -> bool
fn readiness_for_repair_serverless(&self) -> bool
Source§impl RuntimeQueryPort for RedDBRuntime
impl RuntimeQueryPort for RedDBRuntime
fn execute_query(&self, query: &str) -> Result<RuntimeQueryResult, RedDBError>
fn explain_query(&self, query: &str) -> Result<RuntimeQueryExplain, RedDBError>
fn scan_collection( &self, collection: &str, cursor: Option<ScanCursor>, limit: usize, ) -> Result<ScanPage, RedDBError>
fn search_similar( &self, collection: &str, vector: &[f32], k: usize, min_score: f32, ) -> Result<Vec<SimilarResult>, RedDBError>
fn search_ivf( &self, collection: &str, vector: &[f32], k: usize, n_lists: usize, n_probes: Option<usize>, ) -> Result<RuntimeIvfSearchResult, RedDBError>
fn search_hybrid( &self, vector: Option<Vec<f32>>, query: Option<String>, k: Option<usize>, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, graph_pattern: Option<RuntimeGraphPattern>, filters: Vec<RuntimeFilter>, weights: Option<RuntimeQueryWeights>, min_score: Option<f32>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
fn search_text( &self, query: String, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, fields: Option<Vec<String>>, limit: Option<usize>, fuzzy: bool, ) -> Result<QueryResult, RedDBError>
fn search_multimodal( &self, query: String, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
fn search_index( &self, index: String, value: String, exact: bool, collections: Option<Vec<String>>, entity_types: Option<Vec<String>>, capabilities: Option<Vec<String>>, limit: Option<usize>, ) -> Result<QueryResult, RedDBError>
fn search_context( &self, input: SearchContextInput, ) -> Result<ContextSearchResult, RedDBError>
fn resolve_semantic_api_key( &self, provider: &AiProvider, ) -> Result<String, RedDBError>
Source§impl RuntimeSchemaPort for RedDBRuntime
impl RuntimeSchemaPort for RedDBRuntime
fn create_table( &self, input: CreateTableInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn drop_table( &self, input: DropTableInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn create_timeseries( &self, input: CreateTimeSeriesInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn drop_timeseries( &self, input: DropTimeSeriesInput, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RuntimeTreePort for RedDBRuntime
impl RuntimeTreePort for RedDBRuntime
fn create_tree( &self, input: CreateTreeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn drop_tree( &self, input: DropTreeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn insert_tree_node( &self, input: InsertTreeNodeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn move_tree_node( &self, input: MoveTreeNodeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn delete_tree_node( &self, input: DeleteTreeNodeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn validate_tree( &self, input: ValidateTreeInput, ) -> Result<RuntimeQueryResult, RedDBError>
fn rebalance_tree( &self, input: RebalanceTreeInput, ) -> Result<RuntimeQueryResult, RedDBError>
Source§impl RuntimeVcsPort for RedDBRuntime
impl RuntimeVcsPort for RedDBRuntime
fn vcs_commit(&self, input: CreateCommitInput) -> Result<Commit, RedDBError>
fn vcs_branch_create(&self, input: CreateBranchInput) -> Result<Ref, RedDBError>
fn vcs_branch_delete(&self, name: &str) -> Result<(), RedDBError>
fn vcs_tag_create(&self, input: CreateTagInput) -> Result<Ref, RedDBError>
fn vcs_list_refs(&self, prefix: Option<&str>) -> Result<Vec<Ref>, RedDBError>
fn vcs_checkout(&self, input: CheckoutInput) -> Result<Ref, RedDBError>
fn vcs_merge(&self, input: MergeInput) -> Result<MergeOutcome, RedDBError>
fn vcs_cherry_pick( &self, connection_id: u64, commit: &str, author: Author, ) -> Result<MergeOutcome, RedDBError>
fn vcs_revert( &self, connection_id: u64, commit: &str, author: Author, ) -> Result<Commit, RedDBError>
fn vcs_reset(&self, input: ResetInput) -> Result<(), RedDBError>
fn vcs_log(&self, input: LogInput) -> Result<Vec<Commit>, RedDBError>
fn vcs_diff(&self, input: DiffInput) -> Result<Diff, RedDBError>
fn vcs_status(&self, input: StatusInput) -> Result<Status, RedDBError>
fn vcs_lca(&self, a: &str, b: &str) -> Result<Option<String>, RedDBError>
fn vcs_conflicts_list( &self, merge_state_id: &str, ) -> Result<Vec<Conflict>, RedDBError>
fn vcs_conflict_resolve( &self, conflict_id: &str, resolved: Value, ) -> Result<(), RedDBError>
fn vcs_resolve_as_of(&self, spec: AsOfSpec) -> Result<u64, RedDBError>
fn vcs_resolve_commitish(&self, spec: &str) -> Result<String, RedDBError>
fn vcs_set_versioned( &self, collection: &str, enabled: bool, ) -> Result<(), RedDBError>
fn vcs_list_versioned(&self) -> Result<Vec<String>, RedDBError>
fn vcs_is_versioned(&self, collection: &str) -> Result<bool, RedDBError>
Auto Trait Implementations§
impl Freeze for RedDBRuntime
impl !RefUnwindSafe for RedDBRuntime
impl Send for RedDBRuntime
impl Sync for RedDBRuntime
impl Unpin for RedDBRuntime
impl UnsafeUnpin for RedDBRuntime
impl !UnwindSafe for RedDBRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request