Ranvier.Persistence.Marten 0.1.1

dotnet add package Ranvier.Persistence.Marten --version 0.1.1
                    
NuGet\Install-Package Ranvier.Persistence.Marten -Version 0.1.1
                    
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="Ranvier.Persistence.Marten" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ranvier.Persistence.Marten" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Ranvier.Persistence.Marten" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ranvier.Persistence.Marten --version 0.1.1
                    
#r "nuget: Ranvier.Persistence.Marten, 0.1.1"
                    
#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.
#:package Ranvier.Persistence.Marten@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ranvier.Persistence.Marten&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Ranvier.Persistence.Marten&version=0.1.1
                    
Install as a Cake Tool

Ranvier.Persistence.Marten

Marten/PostgreSQL storage for Ranvier.Persistence, targeting .NET 10. The adapter is a separate package; Marten does not become a dependency of the core or persistence packages.

open Marten
open Ranvier.Persistence
open Ranvier.Persistence.Marten

use database = DocumentStore.For connectionString
let store = MartenStateStore(database, "customer-42") :> IStateStore

The caller owns database. Each operation uses a fresh session. The nonblank scope is a Marten tenant: loads, deletes and Clear affect that scope only. Use a scope per application state partition, not per call. Marten's normal schema management applies to the adapter's MartenStateDocument mapping.

  • SaveMany commits a whole batch in one PostgreSQL transaction.
  • ETag = None unconditionally inserts or replaces a record.
  • A loaded record has an opaque ETag. Pass it back to require that version: stale or deleted records fault the batch with JasperFx.ConcurrencyException, possibly wrapped in AggregateException. Reload after a successful conditional save to get its new ETag.
  • Duplicate keys in a save and malformed ETags raise ArgumentException before committing.
  • Keys are case-sensitive; empty keys round-trip at the store level. Keys must be valid Unicode.
  • PersistSession currently writes None, so ordinary persisted signals retain last-writer-wins behaviour. Explicit conditional saves are available through IStateStore.

For a graph round trip and conditional updates, see the Marten guide.

Integration tests

Use a disposable PostgreSQL database. Set RANVIER_MARTEN_CONNECTION, then run:

dotnet test tests/Ranvier.Persistence.Marten.Tests -c Release

The suite reuses the shared persistence conformance cases and optimistic-store cases. It also checks competing writers, atomic rollback, tenant isolation, unusual keys and a graph restart. Missing configuration or an unavailable database fails the suite.

The build CLI's ordinary test pipeline excludes this integration project; CI runs it separately with PostgreSQL.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 51 11/14/2026
0.1.1-preview.1 67 10/28/2026
0.1.0-preview.1 61 10/26/2026

Pre-1.0 release. The API may change before 1.0.