SurrealDb.Reactive 0.7.0

dotnet add package SurrealDb.Reactive --version 0.7.0                
NuGet\Install-Package SurrealDb.Reactive -Version 0.7.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SurrealDb.Reactive" Version="0.7.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SurrealDb.Reactive --version 0.7.0                
#r "nuget: SurrealDb.Reactive, 0.7.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
0.7.0 95 12/12/2024
0.6.0 140 10/21/2024
0.5.1 416 7/12/2024
0.5.0 500 4/4/2024
0.4.0 175 2/8/2024
0.3.1 154 1/19/2024
0.2.0 355 11/21/2023