Getting started with SurrealDB using our Rust SDK

SurrealDB
2,892 views September 10, 2025

👉 In this tutorial, we’ll walk through how to get started with the Rust SDK for SurrealDB. You’ll learn how to set up a Rust project with Cargo, connect to SurrealDB, run queries, deserialize results into Rust structs, and use handy tips like Value, Resource, and environment variables to make development faster and more flexible. By the end, you’ll be able to prototype and build Rust apps with SurrealDB in both embedded and cloud modes - without unnecessary recompilation. Chapters 00:00 - Intro 00:20 - Setting up a Rust project with Cargo 01:12 - Running queries and handling results 02:08 - Using .take() and deserializing into structs 02:53 - Working with Value for quick prototyping 03:30 - Using .create() and Resource for type-safe inserts 04:09 - Adding JSON content with serde_json 04:37 - Switching between embedded and cloud with environment variables 06:29 - Conclusion --- Resources --- ☁️ Start free on Surreal Cloud: https://surrealdb.com/cloud 🎓 SurrealDB University: https://surrealdb.com/learn 📚 Docs: https://surrealdb.com/docs 🎩 Surrealist (GUI): https://surrealdb.com/surrealist ⭐️ GitHub: https://github.com/surrealdb/surrealdb --- What is SurrealDB? --- SurrealDB is an AI-native, multi-model database built in Rust that unifies document, graph, time-series, relational, geospatial and key-value data models into a single engine. Combined with powerful search and retrieval (vector, full-text, hybrid), real-time and event-driven capabilities, and Spectron - its persistent memory layer for AI agents - SurrealDB provides the complete context layer so that models run next to the data, context remains synchronised, and application logic stays simple and dependable. --- Connect --- 🐦 Twitter: https://twitter.com/surrealdb 👩‍💻 LinkedIn: https://www.linkedin.com/company/surrealdb/ 💬 Discord: https://discord.com/invite/surrealdb 🛍️ Merch: https://surrealdb.store/

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close