Skip to main content

Crate valence

Crate valence 

Source
Expand description

Valence is a schema-driven ORM for Rust: declare typed tables with valence_schema!, generate Model CRUD at build time, and wire storage through Valence::builder without locking into one database.

Typed schemas and models with composable storage adapters.

§Features

  • Schema DSL — fields, connections, policies, ownership, TTL, and trait mixins (valence_schema!, valence_trait_schema!)
  • Build-time codegen — typed models from host schemas/ via valence-codegen
  • Composable backends — in-memory, SQLite, IndraDB, SurrealDB, Postgres, MongoDB, Redis
  • Multi-backend routing — one DatabaseRouter; each schema picks a backend with database: / DatabaseFromEngine
  • Host ports — secrets, actor identity, endpoints, and telemetry injected at boot
  • Privacy-aware CRUD — policy and ownership hooks on generated Model paths

Enable backends with Cargo features (mem is the default). The crate README.md lists every feature flag and environment variable.

§Getting started

Follow these steps in order. Each linked API page includes details for that task.

§1. Choose and wire storage

BackendTypeFeatureTopologyWhen to use
In-memoryInMemoryBackendmem (default)embeddedLocal experiments; tests
SQLiteSqliteBackendsqliteembeddedDurable single-host store
IndraDBIndradbBackendindradbembeddedGraph-oriented workloads
SurrealDBSurrealEmbeddedBackendsurrealembeddedSurreal engine in-process
PostgresPostgresBackendpostgresremoteWire Postgres (DATABASE_URL)
MongoDBMongoBackendmongodbremoteWire Mongo (VALENCE_MONGODB_URI)
RedisRedisBackendredisremoteWire Redis (VALENCE_REDIS_URL)

§Select a backend in the schema

A schema does not contain a backend instance. Its database: field points to a stable DatabaseFromEngine evaluator. The evaluator combines:

  • a logical name (for example "default") that must match ValenceBuilder::add_backend, and
  • an engine ID exported by the selected adapter.

Define COUNTER_DB for the backend you enable:

BackendCOUNTER_DB declaration
In-memoryDatabase::from_engine("default", MEM_ENGINE_ID)
SQLiteDatabase::from_engine("default", SQLITE_ENGINE_ID)
IndraDBDatabase::from_engine("default", INDRADB_ENGINE_ID)
SurrealDBDatabase::from_engine("default", SURREAL_ENGINE_ID)
PostgresDatabase::from_engine("default", POSTGRES_ENGINE_ID)
MongoDBDatabase::from_engine("default", MONGODB_ENGINE_ID)
RedisDatabase::from_engine("default", REDIS_ENGINE_ID)

Then use that evaluator in the same Counter schema:

use valence::{Database, DatabaseFromEngine, FieldType, valence_schema};

// Choose the engine constant for the enabled backend.
pub const COUNTER_DB: DatabaseFromEngine =
    Database::from_engine("default", valence::MEM_ENGINE_ID);

valence_schema! {
    Counter {
        table: "counter",
        version: "0.1.0",
        description: "Simple counter",
        database: COUNTER_DB,
        fields: [
            id: { r#type: FieldType::String, primary_key: true, required: true },
            value: { r#type: FieldType::Integer, required: true },
        ],
    }
}

Omitting database: selects DEFAULT_IN_MEMORY ("default" + MEM_ENGINE_ID). If that router key is absent, the current runtime falls back to its active/default backend. Declare database: explicitly for clear behavior and for any runtime with multiple backends.

In-memory first run:

use std::sync::Arc;
use valence::{
    Database, DatabaseFromEngine, FieldType, InMemoryBackend, Valence, MEM_ENGINE_ID,
    valence_schema,
};

const COUNTER_DB: DatabaseFromEngine =
    Database::from_engine("default", MEM_ENGINE_ID);

valence_schema! {
    Counter {
        table: "counter",
        version: "0.1.0",
        database: COUNTER_DB,
        fields: [
            id: { r#type: FieldType::String, primary_key: true, required: true },
            value: { r#type: FieldType::Integer, required: true },
        ],
    }
}

let valence = Valence::builder()
    .add_backend("default", Arc::new(InMemoryBackend::new()))
    .build()?;
assert_eq!(valence.backend_for_table("counter")?.engine_id(), MEM_ENGINE_ID);

Runnable: cargo run -p valence --example quickstart --features mem

§2. Declare schemas

Schemas are the typed contracts Valence registers and (via codegen) turns into models.

use valence::{
    Database, DatabaseFromEngine, FieldType, MEM_ENGINE_ID, valence_schema,
};

const COUNTER_DB: DatabaseFromEngine =
    Database::from_engine("default", MEM_ENGINE_ID);

valence_schema! {
    Counter {
        table: "counter",
        version: "0.1.0",
        description: "Simple counter",
        database: COUNTER_DB,
        fields: [
            id: { r#type: FieldType::String, primary_key: true, required: true },
            value: { r#type: FieldType::Integer, required: true },
        ],
    }
}

Replace MEM_ENGINE_ID with the engine constant from the table in step 1 when the Counter belongs on another backend.

See valence_schema! and valence_trait_schema! for the DSL field reference. Minimal schema example: workspace examples/minimal-schema. Macros and valence-codegen share one syn DSL parser (valence-schema-dsl), so host schemas/*_valence_schema.rs files accept the same syntax and semantics (including database: evaluators).

§3. Set up build-time codegen

Typed Model impls are generated at compile time from schema files under schemas/ (for example widget_valence_schema.rs). Add a build dependency and a one-line build.rs:

[dependencies]
uf-valence = { git = "https://github.com/unified-field-dev/valence", package = "uf-valence", features = ["mem"] }

[build-dependencies]
uf-valence-codegen = { git = "https://github.com/unified-field-dev/valence", package = "uf-valence-codegen" }
// build.rs
fn main() {
    valence_codegen::build().expect("valence codegen failed");
}

Include generated models (this is what must be linked for typed CRUD and inventory):

valence::include_generated_models!();

Schema files under schemas/ are scan inputs for codegen; they are not mod-linked. End-to-end proof: workspace examples/codegen-host and examples/product-model-host. See the valence-codegen crate docs for custom roots via build_with / CodegenConfig.

§4. Use generated models (CRUD)

After codegen, call Model methods with a Valence runtime:

use valence::Model;

// Widget is generated from schemas/widget_valence_schema.rs
let created = Widget::create(widget, &valence).await?;
let loaded = Widget::get(created.id(), &valence).await?;
Widget::update(created.id(), updated, &valence).await?;
Widget::delete(created.id(), &valence).await?;

Product-shaped schemas and connections: examples/product-model-host.

§5. Route multiple backends

One Valence holds a heterogeneous DatabaseRouter. Schema database: evaluators pick the router key per table.

use std::sync::Arc;
use valence::{InMemoryBackend, Valence, router_key, MEM_ENGINE_ID};

let primary = router_key("primary", MEM_ENGINE_ID);
let valence = Valence::builder()
    .add_backend("primary", Arc::new(InMemoryBackend::new()))
    .add_backend("archive", Arc::new(InMemoryBackend::new()))
    .default_backend_key(primary)
    .build()?;

Runnable: cargo run -p valence --example multi_backend --features mem

§6. Inject host ports

Optional builder methods wire secrets, actor identity, endpoints, and telemetry: ValenceBuilder::secret_provider, ValenceBuilder::actor_factory, ValenceBuilder::endpoint_resolver, ValenceBuilder::telemetry_sink.

Port table and reference impls: valence_core::ports. Storage adapter contract and third-party checklist: DatabaseBackend. Router semantics: DatabaseRouter.

use std::sync::Arc;
use valence::{
    ConsoleSink, EnvSecretProvider, InMemoryBackend, JsonActorFactory, NoopEndpointResolver,
    Valence,
};

let _valence = Valence::builder()
    .add_backend("default", Arc::new(InMemoryBackend::new()))
    .secret_provider(Arc::new(EnvSecretProvider))
    .actor_factory(Arc::new(JsonActorFactory))
    .endpoint_resolver(Arc::new(NoopEndpointResolver))
    .telemetry_sink(Arc::new(ConsoleSink))
    .build()?;
schemas/*.rs ──► build.rs (valence_codegen::build) ──► $OUT_DIR/generated_models.rs
  (scan inputs)                                              │
                                                             │ include_generated_models!
                                                             ▼
                                             impl Model + inventory submit
                                                             │
                             SchemaRegistry ◄────────────────┤
                                                             ▼
                                             typed CRUD on Valence
                                                             │
                             Valence runtime ◄── DatabaseRouter / backends

Dependency rules: valence-core owns ports and runtime (no engine SDK); valence-backend-* advertise open ENGINE_IDs; the facade re-exports behind features; apps own schema roots and call valence-codegen from build.rs; one operation stays on one backend; host adapters inject at boot.

§Next steps

TaskStart here
Schema DSL fieldsvalence_schema!, valence_trait_schema!
Build-time codegenvalence-codegen, examples/codegen-host
Wire storageValence::builder(), InMemoryBackend
Model CRUDModel, examples/product-model-host
Multi-backend routingDatabaseRouter, multi_backend example
Custom adapterDatabaseBackend, examples/acme-valence-backend-stub
SQLiteSqliteBackend, quickstart_sqlite example
IndraDBIndradbBackend, quickstart_indradb example
Surreal embeddedSurrealEmbeddedBackend, surreal_embedded example
PostgresPostgresBackend, quickstart_postgres (env-gated)
MongoDBMongoBackend, quickstart_mongodb (env-gated)
RedisRedisBackend, quickstart_redis (env-gated)
Admin runtimeSchemaRegistry, QueryCore, examples/admin-runtime-host
Config / env varscrate README.md

§Entry points

§Prerequisites and gotchas

  • Enable backend features explicitly (mem is on by default).
  • Product schemas and codegen roots belong in your application.
  • Wire adapters (postgres/mongodb/redis) need live URLs; examples skip cleanly when unset.
  • SurrealDB support lives in valence-backend-surreal (feature surreal), not in core ports.
  • Generated models (or macro-expanded schemas) must be linked into the binary or inventory will not see them.

§Runnable examples

ExampleFeaturesNotes
quickstartmemSchema + mem boot + registry proof
multi_backendmemMultiple logical backends
quickstart_sqlitesqliteEmbedded SQLite
quickstart_indradbindradbEmbedded IndraDB
surreal_embeddedsurrealSurreal mem engine
quickstart_postgrespostgresRequires DATABASE_URL
quickstart_mongodbmongodbRequires VALENCE_MONGODB_URI
quickstart_redisredisRequires VALENCE_REDIS_URL
quickstart_telemetrymem,telemetry-consoleConsole telemetry sink
cargo run -p valence --example quickstart --features mem
cargo run -p valence --example quickstart_sqlite --features sqlite
cargo run -p valence --example quickstart_indradb --features indradb
cargo run -p valence --example surreal_embedded --features surreal

Modules§

actor
Actor identity for privacy checks and audit trails.
admin_entity_delete
Table-keyed queued delete for admin tooling.
backend
Pluggable database backends for Valence.
batch
Batch create hooks for codegen BatchCreatable impls (full batch runtime is host-owned).
compiled_query
Parameterized statement for crate::backend::DatabaseBackend::execute_compiled_query.
compiled_query_factory
Dialect-specific compiled queries for deletion DAG and ownership helpers.
connection
Connection cardinality, delete semantics, and id helpers for generated models.
database_retry
Retry database operations when the engine reports retryable transaction contention.
deletion
Cascading delete orchestration — dispatch hooks and DAG planning.
entity
Privacy-filtered entity view for admin tooling.
error
Error types for Valence routing and backends.
evaluator
Runtime resolution of which crate::backend::DatabaseBackend a schema uses.
instrumentation
Instrumentation hooks for Valence runtime metrics and events.
inventory
githubcrates-iodocs-rs
iter
Row-level iter descriptor types for valence_schema! { iters: [...] }.
known_engines
Stable engine id slugs for first-party reference adapters.
model
Model contracts generated from schema DSL.
owner_ref
Stable owner identity for row-level ownership metadata.
ownership
First-class data ownership (platform tables + hooks from generated CRUD).
ports
Host-injectable ports (secrets, identity, endpoints).
prelude
Ergonomic imports for schema authoring and generated models.
privacy
Field-level privacy evaluation for generated models and admin queries.
privacy_policies
Re-export built-in privacy policy constants for schema authors.
query
Admin/query builder — composable filters, sorts, and compiled SQL execution.
query_compiler
Query compilation from crate::query::QueryCore to crate::compiled_query::CompiledQuery.
query_compiler_registry
Registry mapping DatabaseBackend::engine_id to query compilers.
read_cache
Valence-wide read-through LRU for Model::get-shaped point reads.
record_id
Backend-agnostic record identifier (table + id).
reference
Reference placeholders for batch entity creation.
registry
Generic string-keyed registry (inventory + HashMap, no quark dependency).
router
Named backend registry (heterogeneous engines per router).
router_key
Compound router keys: "{engine_id}:{logical_name}".
row_json
JSON row helpers shared by query fetch paths.
runtime
Valence runtime handle and builder.
schema
Schema metadata registration hooks for valence_schema!.
schema_api
Structured schema metadata produced by the Valence DSL.
schema_types
DSL type vocabulary used by valence_schema! and valence_trait_schema!.
side_effect
Side effect types for post-mutation hooks.
trait_registry
Runtime trait metadata registry.
trait_schema
Trait schema metadata for valence_trait_schema!.
ttl
Table-level TTL policy hooks.
validation
Field validation framework

Macros§

include_generated_models
Include $OUT_DIR/generated_models.rs produced by valence_codegen::build.
valence_schema
Defines a Valence model schema at compile time.
valence_trait_schema
Defines a reusable trait schema (fields, optional connections, optional policies).

Structs§

BackendCapabilities
Capabilities advertised by a storage adapter (telemetry labels and contract tests).
CompiledQuery
ConsoleSink
Writes telemetry to stderr (development and bench).
Database
Convenience namespace for built-in evaluators.
DatabaseFromEngine
Built-in evaluator: look up logical_name + engine_id on a DatabaseRouter.
DatabaseRouter
Maps compound router keys to concrete DatabaseBackend implementations.
DeletionRequest
Payload passed to the registered deletion dispatcher (typically starts a host job orchestrator).
DeletionService
EnvEndpointResolver
Resolve physical database URLs from env at bootstrap.
EnvSecretProvider
Read secrets from process environment variables (key = env var name).
FieldChange
ForeignKeyRef
Normalized foreign-key/reference metadata for a field.
HopSource
A previous query in the hop chain. Compiled at execution time.
InMemoryBackend
In-memory DatabaseBackend storing rows and graph edges in process memory.
IndraQueryCompiler
Compiles QueryCore to parameterized SQL (document-row subset) for IndraDB.
IndradbBackend
Embedded IndraDB DatabaseBackend mapping Valence tables to vertex types.
InstrumentedBackend
Wraps an inner backend and emits instrumentation telemetry on every I/O call.
IterDescriptor
One registered iter implementation for a table (submitted by valence_schema!).
IterEvaluation
Result of an iter should_run hook.
JsonActorContext
ActorContext that stores JSON as-is.
JsonActorFactory
Reference factory that wraps JSON in JsonActorContext.
KnownEngines
Well-known DatabaseBackend::engine_id values shipped with this workspace.
MongoBackend
MongoDB-backed DatabaseBackend storing JSON documents per collection.
MongoQueryCompiler
Compiles QueryCore for the MongoDB adapter.
Mutation
MutationTimer
Timer for mutation wall time (L1).
NoOpSecretProvider
Always returns Ok(None) — default when no provider is configured.
NoOpSink
Discards all telemetry (default for tests and minimal hosts).
NoopEndpointResolver
Always returns Ok(None).
OwnerRef
Resolved owner for a row (stored in ownership tables at the host layer).
OwnershipConfig
Ownership behavior declared in schema DSL (ownership: { ... }).
OwnershipService
Ownership persistence and transfer helpers.
PostgresBackend
Postgres-backed DatabaseBackend using JSONB document rows.
PrivacyError
Error returned when a privacy rule blocks field access.
PrivacyEvaluator
Privacy evaluation engine
QueryCompilerRegistry
Resolves a QueryCompiler for a storage engine slug.
QueryCore
Core query builder that compiles per registered engine.
RecordId
RecordedCounter
Captured counter increment.
RecordedEvent
Captured structured log event.
RecordedGauge
Captured gauge sample.
RecordingSink
Append-only in-memory sink for assertions in unit and integration tests.
RedisBackend
Redis-backed DatabaseBackend storing JSON documents per table/id key.
RedisQueryCompiler
Compiles QueryCore for the Redis adapter.
Reference
ReferencedEntity
RegisterEmbeddedLogicalNamesOptions
Options for embedded logical name registration.
ResolverContext
RouterValenceFactory
ValenceFactory backed by a shared DatabaseRouter.
RouterValenceFactoryConfig
Host wiring template applied when building from a shared router.
Schema
Complete runtime schema produced from valence_schema!.
SchemaConnection
Connection/relationship definition from schema DSL.
SchemaConnectionsOverlayInit
Codegen-submitted trait-merged connections for deletion graph and tooling.
SchemaEdge
Edge/relationship definition retained for older schema shapes.
SchemaField
Expanded metadata for one field declared in fields: [...].
SchemaMeta
Schema metadata summary block.
SchemaMetadataInit
Lazy initializer submitted via inventory::submit!.
SchemaPolicies
Full entity-level policy declaration for the schema.
SchemaPolicyRule
One policy rule reference stored in schema metadata.
SchemaPolicyRules
Policy rule buckets for a single CRUD operation.
SchemaPrivacy
Top-level privacy summary for a schema.
SchemaRegistry
Owned registry for schema metadata.
SchemaTtlPolicy
SqlQueryCompiler
Compiles QueryCore to parameterized SQL.
SqliteBackend
SQLite-backed DatabaseBackend using JSON document rows.
StaticEndpointResolver
In-memory map of logical name → URL.
SurrealEmbeddedBackend
Wraps a local Surreal handle (memory, RocksDB, etc.).
SurrealQueryCompiler
Compiles QueryCore to parameterized SurrealQL.
SurrealRemoteBackend
Wraps a remote-capable Surreal<Any> client (WebSocket / HTTP / …).
TraitDefinition
Runtime metadata for a single Valence trait definition.
TraitDefinitionInit
Lazy initializer for trait definitions.
TraitFieldDef
Minimal field descriptor stored in trait definitions.
TraitImplementor
Links a concrete table to the trait it implements.
TraitPolicies
Entity-level privacy policies declared by a trait.
TraitPolicyRules
Policy rule names for a single CRUD operation bucket.
TraitRegistry
Valence
Host-assembled Valence handle.
ValenceBuilder
Builder for constructing a Valence runtime.
ValenceEntity

Enums§

Actor
Who or what is performing a Valence operation.
BackendTtlCapability
Cardinality
DateTimePredicate
Predicate for datetime fields.
EmbeddedEngine
Embedded Surreal engine selection.
Error
FieldOperation
Field access direction for privacy checks.
FieldType
Field data types accepted by the Valence DSL.
HopType
Describes how a hop connects a source query to a target query.
IntPredicate
Predicate for integer fields.
MutationKind
NullPredicate
Predicate for checking null/not-null on optional fields.
OnDelete
OwnerKind
Kind of principal that owns a row.
PrivacyOperation
Which CRUD operation is being checked.
RecordPredicate
Predicate for record-link fields (stored as Surreal RecordId).
Role
Role markers used by older privacy/mutation DSL shapes.
SortDirection
Sort direction for ordering query results.
StringPredicate
Predicate for string/text fields.
Validator
Built-in validators attachable to schema or trait fields.

Constants§

DEFAULT_EMBEDDED_SURREAL_LOGICAL_NAMES
Include in bootstrap registration so schemas that omit explicit database: still resolve.
DEFAULT_IN_MEMORY
DEFAULT_IN_MEMORY_ROUTER_KEY
Router key for default in-memory backend (inmemory_mem:default).
INDRADB_ENGINE_ID
Stable engine slug for router keys (indradb:logical_name).
INDRADB_PRIMARY
Schema evaluator const for database: routing.
MEM_ENGINE_ID
Stable engine slug for router keys (inmemory_mem:logical_name).
MONGODB_ENGINE_ID
Stable engine slug for router keys (mongodb:logical_name).
MONGODB_PRIMARY
Schema evaluator const for database: routing.
POSTGRES_ENGINE_ID
Stable engine slug for router keys (postgres:logical_name).
POSTGRES_PRIMARY
Schema evaluator const for database: routing.
REDIS_ENGINE_ID
Stable engine slug for router keys (redis:logical_name).
REDIS_PRIMARY
Schema evaluator const for database: routing.
SQLITE_ENGINE_ID
Stable engine slug for router keys (sqlite:logical_name).
SQLITE_PRIMARY
Schema evaluator const for database: routing.
SURREAL_ENGINE_ID
Stable engine slug for router keys (surrealdb:logical_name).

Traits§

ActorContext
Request-scoped identity view used by privacy and ownership checks.
ActorFactory
Build an ActorContext from opaque JSON at the Valence port boundary.
BatchCreatable
Marker trait for models participating in batch create codegen.
DatabaseBackend
Storage engine behind Valence: CRUD, compiled queries, and graph edges.
DatabaseEndpointResolver
Resolve a physical connection URL for a logical database name at bootstrap.
DatabaseEvaluator
IdHolder
Model
Core trait that all generated models implement.
PolicyEvaluator
Per-rule evaluator referenced from schema metadata (not registered on the builder).
QueryCompiler
Compiles QueryCore for one database dialect.
SchemaMetadata
Compile-time schema metadata access for generated models (trait; struct is crate::schema::SchemaMetadata).
SecretProvider
Resolve secret material by key at runtime.
SideEffect
TelemetrySink
Host-injectable telemetry sink for Valence ORM metrics and events.
ValenceFactory
Factory for reconstructing Valence instances outside request context.
WithReference

Functions§

bootstrap_embedded_router
Bootstrap an embedded router from explicit logical names.
bootstrap_embedded_router_from_inventory
Bootstrap an embedded router using schema inventory discovery.
collect_distinct_embedded_surreal_logical_names
Distinct embedded Surreal logical names from every linked valence_schema! plus defaults.
compile_for_engine
Compile core for the given backend engine id.
connect_embedded_at_path
Open an embedded Surreal database at path, pin namespace/database, optionally clear stale lock.
connect_embedded_from_env
Open embedded Surreal using neutral env vars.
database_from_env
Read database name from VALENCE_DB (default prod).
dispatch
Invoke the dispatcher if configured.
embedded_engine_from_env
Read embedded engine from VALENCE_EMBEDDED_ENGINE (default RocksDB).
embedded_path_from_env
Read store path from VALENCE_EMBEDDED_PATH (default surreal/data).
extract_id_from_record
extract_id_from_record_display
Strip the first table: prefix from a Surreal thing display string; return the id portion.
extract_id_from_select_value
Parse a row from SELECT VALUE id (JSON) into the record id string (no table: prefix).
get_record_via_cache
Point-get with optional read-through cache (raw row, pre-privacy).
get_record_with_ownership_bundle_via_cache
Unified Model::get fetch: one backend round trip for row + ownership gate status (when cache cold).
global_compiler_registry
Global registry populated from enabled compiler features.
id_from_model
install_default_mem_router
Register the default in-memory backend under DEFAULT_IN_MEMORY_ROUTER_KEY.
install_telemetry_sink
Install the process-wide Valence telemetry sink (tests and host boot).
invalidate
Drop a cached row after a write or ownership status change.
is_deletion_dispatcher_registered
True if register_deletion_dispatcher (or a test dispatcher) was installed in this process.
json_value_to_fields
Flatten a JSON object into string field pairs for sinks that only store tuples.
namespace_from_env
Read namespace/database from VALENCE_NS / VALENCE_DB (default prod/prod).
queue_delete_entity
read_cache_enabled
Whether the read-through record cache is active (default on; VALENCE_READ_CACHE=0 disables).
register_deletion_dispatcher
Register the process-wide deletion dispatcher (call once from server bootstrap).
register_embedded_logical_names
Register one embedded Surreal handle under each logical name.
register_embedded_logical_names_from_inventory
Register embedded logical names discovered from schema inventory.
register_embedded_logical_names_slices
Register db under every distinct logical name in groups (deduplicated).
register_noop_deletion_dispatcher_for_tests
Install a no-op dispatcher when the slot is still empty (integration tests, harness crates).
retry_on_database_tx_conflict
Retry an async Valence operation when is_retryable_transaction_contention applies.
router_key
Build the compound router key used for registration and resolution.
schema_connections_for_table
Connections for table_name, preferring macro-registered schema connections.
shared_router_with_embedded_logical_names
Build a router with embedded Surreal registered for each logical name.
surreal_record_id_for
Build a SurrealDB record id for a table and id string.
telemetry_sink
Current sink, or NoOpSink when none is installed.
try_log_event
Emit a structured event from flat field tuples.
try_log_event_value
Emit a structured event from a JSON payload (instrumentation default).
try_record_counter
Emit a counter when a sink is installed.
try_record_gauge
Emit a gauge when a sink is installed.
wrap_backend
Wrap inner with InstrumentedBackend.

Type Aliases§

IterExecuteFn
Type-erased execute for orchestration (row as JSON).
IterShouldRunFn
Type-erased should_run for orchestration (row as JSON).
Result
SDb
Embedded Surreal client type.
SchemaMetadataStruct
Alias used by valence_schema! codegen.
SurrealMemBackend
Alias for SurrealEmbeddedBackend (historical template name).