Expand description
Library entrypoints for embedding SurrealDB server inside another Rust application.
Exposes the same init() used by the surreal binary so external apps can
start SurrealDB within their own main().
Unstable!
This crate is SurrealDB internal API. It does not adhere to SemVer and its API is free to change and break code even between patch versions. If you are looking for a stable interface to the SurrealDB library please have a look at the Rust SDK.Modules§
- core
- Re-export
corefor convenience so embedders canuse surreal::core::.... - ntw
- Make
ntwpublic so embedders can access RouterFactory and related networking definitions when running SurrealDB as a library. - rpc
- Make
rpcpublic so embedders can access RpcState and related router definitions when running SurrealDB as a library. - sdk
- This library provides a low-level database library implementation, a remote client and a query language definition, for SurrealDB, the ultimate cloud database for tomorrow’s applications. SurrealDB is a scalable, distributed, collaborative, document-graph database for the realtime web.
Structs§
Traits§
- Config
Check - Trait for validating configuration before system initialization.
- Config
Check Requirements - Router
Factory - Re-export
RouterFactoryfor convenience so embedders canuse surreal::RouterFactory. Factory for constructing the top-level Axum Router used by the HTTP server.
Functions§
- init
- Initialize SurrealDB CLI/server with the same behavior as the
surrealbinary. This spins up a Tokio runtime with a larger stack size and then runs the CLI entrypoint (which starts the server when thestartsubcommand is used).