Skip to content
Sign In

Methods

version

The .version() method for the SurrealDB Rust SDK returns the version of the server.

Returns the version of the server.

Method Syntax
db.version()
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 }

Was this page helpful?