Tips and tricks on using the Rust SDK
Blog post from SurrealDB
The Rust SDK for SurrealDB offers a flexible and versatile framework for accessing and managing data, utilizing an asynchronous builder pattern to maintain compatibility and backward support across various engines. It accommodates both static and dynamic typing, allowing developers to choose between compile-time guarantees and runtime flexibility based on their needs. The SDK is compatible with different asynchronous runtimes, like Tokio and async-std, and supports nine interchangeable engines, including WebSocket, HTTP, and various KV stores, enabling seamless scalability and adaptability without the need for recompilation. The SDK also incorporates trait-based method overloading to streamline operations, such as deleting records, by determining output based on input, thus minimizing errors and enhancing compile-time assurances. Additionally, it allows developers to wait for specific events, like database selection, enabling concurrent operations and improving workflow efficiency. With its modular design, the Rust SDK empowers developers to build lean applications tailored to their specific requirements, ensuring that only essential features are included in the final binary.