Skip to main content

Module store

Module store 

Source
Expand description

SurrealDB store — embedded (kv-surrealkv) or server (WebSocket), selected at runtime via the [graph] mode config key (embedded | server).

Both engines are compiled in by default and dispatched through surrealdb::engine::any, so switching backends is a config change, not a rebuild.

Concurrency: the embedded SurrealKV backend takes a process-exclusive file lock. Concurrent access from a second process fails with GraphError::Locked after a bounded retry. Server mode (or the serve daemon) is the supported way to share one store between processes.

Structs§

MigrationReport
What one migration pass did. edges_backfilled is zero on an already current store.
ServerConfig
Connection config for server mode.

Constants§

SCHEMA_VERSION
Schema version this build writes. Bumped by every migration.

Functions§

connect
Connect to a SurrealDB server (e.g. ws://localhost:8787).
init_schema
Initialize the graph schema, then bring the store up to SCHEMA_VERSION. Idempotent — safe to call on every open.
open
Open (or create) a SurrealDB embedded store at the given path.

Type Aliases§

Db