The SurrealDB SDK for Rust enables you to interact with SurrealDB from client-side, server-side applications, systems, APIs, embedded systems, and IoT devices. The Rust SDK supports structured error handling and type-safe operations, using an asynchronous API for efficient concurrent database interactions. You can use the Rust SDK to interact with your SurrealDB database instances, or to run SurrealDB as an embedded database within your Rust application, with functionality for executing queries, managing data, running database functions, authenticating to the database, building user signup and authentication functionality, and subscribing to data changes with live queries.
The SDK requires Rust version 1.95 or greater, and is available as a crate.
The latest version of the SDK is 3.3.1.
The SDK works with SurrealDB versions v2.0.0 and later, including the current release, v3.3.1.
Getting started
Learn
Concepts
Guides for connecting, authenticating, querying, and working with data.
API Reference
Complete reference for the SDK's methods, types, and errors.
Error handling
Match on error kinds, inspect structured details, and follow the cause chain.
Schema migrations
Keep the schema in .surql files and apply it from Rust code with SurrealKit.
Frameworks
Each framework has a worked example; the frameworks overview lists them together.
Contributing
To contribute to the SDK code, submit an Issue or Pull Request in the Rust SDK repository. To contribute to this documentation, submit an Issue or Pull Request in the docs.surrealdb.com repository.

