The SurrealDB SDK for C# and .NET is the primary SDK for interacting with SurrealDB from server-side applications, systems, and APIs, allowing you to integrate SurrealDB into your website or application backend, and serve dynamic content to your users. You can use the .NET SDK to interact with your SurrealDB database instances, or to run SurrealDB as an embedded database within your C# 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. When connecting to remote database instances, connections automatically reconnect when terminated.
ImportantThe SDK requires .NET version
6.0
or greater, and .NET Standard2.1
or higher, and is available as a NuGet package.
NoteThe SDK works seamlessly with SurrealDB versions
v2.0.0
tov2.1.4
, ensuring compatibility with the latest version.
WarningThis API is not yet fully stabilized and may be subject to change until the SDK reaches
1.0.0
.
To contribute to the SDK code, submit an Issue or Pull Request in the surrealdb.net repository. To contribute to this documentation, submit an Issue or Pull Request in the docs.surrealdb.com repository.
You can find example repositories that demonstrate how to integrate SurrealDB in a number of different environments:
A simple Console app example using the .NET SDK for SurrealDB.
A simple ASP.NET API example project using Minimal APIs.
A Blazor Server app example querying data and consuming Live Query from a remote database.