# version

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

Returns the version of the server.

```rust title="Method Syntax"
db.version()
```

## Example usage

```rust
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`](https://docs.rs/semver/latest/semver/struct.Version.html) struct as defined in the `semver` crate. Sample output:

```text
Version { major: 3, minor: 0, patch: 1 }
```

## See also

* [.version() method on Docs.rs](https://docs.rs/surrealdb/latest/surrealdb/struct.Surreal.html#method.version)
