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§
- Migration
Report - What one migration pass did.
edges_backfilledis zero on an already current store. - Server
Config - 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.