SurrealDB Docs Logo

Enter a search query

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. Output of the above example in October 2024:

Version { major: 2, minor: 0, patch: 3 }

See also

On this page

© SurrealDB GitHub Discord Community Cloud Features Releases Install