version()
Returns the version of the server.
Method Syntax
db.version()
Example usage
use surrealdb::engine::any::connect;
#[tokio::main]
async fn main() -> surrealdb::Result<()> {
let db = connect("ws://localhost:8000").await?;
println!("{:?}", db.version().await?);
Ok(())
}
The function resolves to a Version struct as defined in the semver crate. Sample output:
Version { major: 3, minor: 0, patch: 1 }
See also