SurrealDb.Reactive
0.7.0
dotnet add package SurrealDb.Reactive --version 0.7.0
NuGet\Install-Package SurrealDb.Reactive -Version 0.7.0
<PackageReference Include="SurrealDb.Reactive" Version="0.7.0" />
paket add SurrealDb.Reactive --version 0.7.0
#r "nuget: SurrealDb.Reactive, 0.7.0"
// Install SurrealDb.Reactive as a Cake Addin #addin nuget:?package=SurrealDb.Reactive&version=0.7.0 // Install SurrealDb.Reactive as a Cake Tool #tool nuget:?package=SurrealDb.Reactive&version=0.7.0
SurrealDb.Reactive
Reactive Extensions package for the official SurrealDB SDK for .NET.
Documentation
View the SDK documentation here.
How to install
dotnet add package SurrealDb.Reactive
Getting started
Follow the documentation of the .NET SDK to setup a new SurrealDbClient
. When done, you can now use the methods provided by the Reactive Extensions package for .NET.
Examples - Observe Live Query changes
client
.ObserveTable<PostRecord>("post")
// Similar to observing the query "LIVE SELECT * FROM post;"
.Subscribe(response =>
{
// you can listen to any live query response
});
client
.ObserveTable<PostRecord>("post")
.OfType<SurrealDbLiveQueryCreateResponse<PostRecord>>()
.Select(r => r.Result)
.Subscribe(record =>
{
// you can filter out the LQ type and get every created records in realtime
});
Examples - Record table aggregation
If you want to get a list of all records being created/updated/deleted since watching the Live Query, you can aggregate all the records using the AggregateRecords
.
using var liveQuery = client.ListenLive<PostRecord>(liveQueryUuid);
liveQuery
.GetResults()
.ToObservable()
.AggregateRecords(new Dictionary<string, TestRecord>())
.Select(x => x.Values.ToList())
.Subscribe(records =>
{
// You can consume the list of all records, being updating in realtime on each CREATE, UPDATE or DELETE event
});
Contributing
.NET release versions
The .NET release versions must follow these rules:
- Should target at least the latest LTS (Long-Term Support) version
- Should target at least the latest STS (Standard-Term Support) version
SurrealDb.Net targets .NET versions following the .NET Support Policy by Microsoft. Additionally, SurrealDb.Net targets .NET Standard 2.1 explicitly to continue support of the Mono runtime (Unity, Xamarin, etc...).
Note that the support for .NET standard 2.1 will be maintained until further notice.
Version | Description | Release Date | End of Support |
---|---|---|---|
.NET Standard 2.1 | June 27, 2016 | N/A | |
.NET 6 | LTS | November 8, 2021 | November 12, 2024 |
.NET 7 | STS | November 8, 2022 | May 14, 2024 |
.NET 8 | Current LTS | November 14, 2023 | November 10, 2026 |
Formatting
This project is using CSharpier, an opinionated code formatter.
Command line
You can install it on your machine via dotnet tool
.
# Run this command at the root of the project
dotnet tool install csharpier
You can then use it as a cli:
dotnet csharpier .
The list of command-line options is available here: https://csharpier.com/docs/CLI
IDE integration
CSharpier supports multiple code editors, including Visual Studio, Jetbrains Rider, VSCode and Neovim. You will be able to run format on file save after configuring the settings in your IDE.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- ConcurrentHashSet (>= 1.3.0)
- Dahomey.Cbor (>= 1.24.3)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- Microsoft.Spatial (>= 7.18.0)
- Semver (>= 2.3.0)
- SurrealDb.Net (>= 0.7.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Interactive.Async (>= 6.0.1)
- SystemTextJsonPatch (>= 4.0.0)
- Websocket.Client (>= 5.1.1)
-
net6.0
- ConcurrentHashSet (>= 1.3.0)
- Dahomey.Cbor (>= 1.24.3)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- Microsoft.Spatial (>= 7.18.0)
- Semver (>= 2.3.0)
- SurrealDb.Net (>= 0.7.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Interactive.Async (>= 6.0.1)
- SystemTextJsonPatch (>= 4.0.0)
- Websocket.Client (>= 5.1.1)
-
net7.0
- ConcurrentHashSet (>= 1.3.0)
- Dahomey.Cbor (>= 1.24.3)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- Microsoft.Spatial (>= 7.18.0)
- Semver (>= 2.3.0)
- SurrealDb.Net (>= 0.7.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Interactive.Async (>= 6.0.1)
- SystemTextJsonPatch (>= 4.0.0)
- Websocket.Client (>= 5.1.1)
-
net8.0
- ConcurrentHashSet (>= 1.3.0)
- Dahomey.Cbor (>= 1.24.3)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- Microsoft.Spatial (>= 7.18.0)
- Semver (>= 2.3.0)
- SurrealDb.Net (>= 0.7.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Interactive.Async (>= 6.0.1)
- SystemTextJsonPatch (>= 4.0.0)
- Websocket.Client (>= 5.1.1)
-
net9.0
- ConcurrentHashSet (>= 1.3.0)
- Dahomey.Cbor (>= 1.24.3)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- Microsoft.Spatial (>= 7.18.0)
- Semver (>= 2.3.0)
- SurrealDb.Net (>= 0.7.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Interactive.Async (>= 6.0.1)
- SystemTextJsonPatch (>= 4.0.0)
- Websocket.Client (>= 5.1.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SurrealDb.Reactive:
Package | Downloads |
---|---|
CloudTheWolf.DSharpPlus.Scaffolding.Data
Database System for CloudTheWolf.DSharpPlus.Scaffolding |
GitHub repositories
This package is not used by any popular GitHub repositories.