Purview.EventSourcing.SqlServer
2.0.0-prerelease.39
dotnet add package Purview.EventSourcing.SqlServer --version 2.0.0-prerelease.39
NuGet\Install-Package Purview.EventSourcing.SqlServer -Version 2.0.0-prerelease.39
<PackageReference Include="Purview.EventSourcing.SqlServer" Version="2.0.0-prerelease.39" />
<PackageVersion Include="Purview.EventSourcing.SqlServer" Version="2.0.0-prerelease.39" />
<PackageReference Include="Purview.EventSourcing.SqlServer" />
paket add Purview.EventSourcing.SqlServer --version 2.0.0-prerelease.39
#r "nuget: Purview.EventSourcing.SqlServer, 2.0.0-prerelease.39"
#:package Purview.EventSourcing.SqlServer@2.0.0-prerelease.39
#addin nuget:?package=Purview.EventSourcing.SqlServer&version=2.0.0-prerelease.39&prerelease
#tool nuget:?package=Purview.EventSourcing.SqlServer&version=2.0.0-prerelease.39&prerelease
Purview.EventSourcing.SqlServer
Purview.EventSourcing.SqlServer provides both SQL Server/Azure SQL event-stream persistence and SQL-backed queryable snapshot persistence for Purview Event Sourcing.
Install
dotnet add package Purview.EventSourcing.SqlServer
Register the providers
builder.Services.AddSqlServerEventStore();
builder.Services.AddSqlServerSnapshotQueryableEventStore();
{
"ConnectionStrings": {
"eventstore-sqlserver": "Server=.;Database=MyApp;Trusted_Connection=True;"
}
}
What it provides
- Event-stream persistence for aggregates loaded through
IEventStore - Query/list/count snapshot-backed reads through
IQueryableEventStore - SQL-specific transaction factory (
ISqlServerEventStoreTransactionFactory) for enlisting additional SQL/EF work in the same commit (all enlisted stores must share the same SQL transaction boundary) - SQL Server and Azure SQL configuration binding for both event and snapshot stores
- Entity Framework-backed schema creation and CRUD paths
- JSON-column-backed event and snapshot payload storage
- Shared-table safety: when aggregate types share a table, event-stream reads and deletes are scoped by both aggregate id and aggregate type
- Tolerant replay for long-lived streams: integration-tested handling for unknown event types and schema-evolved/unappliable historical events
Payload shape
The snapshot payload is the fully serialized aggregate graph stored in a single JSON column. EF queries run against that JSON payload, so aggregate properties remain transparent to callers.
Supported members are writable primitives, [Scalar] value objects, complex objects composed of supported members, and EventStoreList<T> / EventStoreSet<T> collections of supported primitive or complex members.
Important query distinction:
- A
[Scalar]value object with a primitive inner value is generally query-friendly. - A
[Scalar]value object with a complex inner value is persisted correctly, but deep predicates through.Valueare not guaranteed to translate in SQL snapshot queries. - If deep SQL predicates are required for a complex concept, expose the underlying complex type directly on the aggregate/query snapshot model (for example, a
ParserReportSummarymirror property) and verify the exact nested predicate with integration tests.
Unsupported shapes fail during model creation, including arrays and collection types other than EventStoreList<T> / EventStoreSet<T> (for example List<T>, IReadOnlyList<T>, IEnumerable<T>, HashSet<T>, ImmutableArray<T>), except where a provider-specific JSON conversion path is explicitly supported and tested, or where the member is marked [EFOpaque]. Read-only and [JsonIgnore] members are excluded from the JSON payload.
Value-type (struct) value objects mapped into the payload must be materializable by EF:
- Declare a parameterless constructor (the
Purview.ValueObjectsgenerator emits one for[ValueObject]structs) or use only scalar constructor parameters. EF cannot bind complex or collection constructor parameters in JSON payloads and reportsEVENTSTOREEF003when no constructor can be used. - Give every complex member declared on a value type an
initorsetaccessor. EF cannot assign a read-only member of a value type and reportsEVENTSTOREEF004. The provider rejects the shape while building the snapshot query model, so it fails withInvalidOperationExceptionnaming the member instead of EF's internalArgumentException: Expression must be writeableat query time.
The snapshot query model writes members through their property accessors (PropertyAccessMode.PreferProperty), so readonly record struct value objects — including value objects nested inside other value objects — round-trip and remain queryable.
Documentation
- Homepage
- Documentation
- SQL Server guide
- Includes behavior notes/caveats (
IsDeletedAsyncmissing behavior, tolerant replay, principal requirements) - Includes snapshot payload/query-translation guidance for scalar value objects vs directly mapped complex mirrors
- Includes behavior notes/caveats (
| Product | Versions 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. |
-
net10.0
- LinqKit (>= 1.3.11)
- Microsoft.Data.SqlClient (>= 7.1.0)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.12)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.12)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.10.0)
- Purview.EventSourcing (>= 2.0.0-prerelease.39)
- Purview.ValueObjects (>= 1.0.0-prerelease.9)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Purview.EventSourcing.SqlServer:
| Package | Downloads |
|---|---|
|
Purview.EventSourcing.Admin.SqlServer
SQL Server query adapters for Purview EventSourcing Admin Portal. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-prerelease.39 | 64 | 9/29/2026 |
| 2.0.0-prerelease.38 | 67 | 9/25/2026 |
| 2.0.0-prerelease.36 | 63 | 9/24/2026 |
| 2.0.0-prerelease.35 | 68 | 9/18/2026 |
| 2.0.0-prerelease.34 | 73 | 9/18/2026 |
| 2.0.0-prerelease.33 | 68 | 9/17/2026 |
| 2.0.0-prerelease.32 | 67 | 9/15/2026 |
| 2.0.0-prerelease.31 | 82 | 9/12/2026 |
| 2.0.0-prerelease.30 | 83 | 9/8/2026 |
| 2.0.0-prerelease.29 | 90 | 8/3/2026 |
| 2.0.0-prerelease.28 | 83 | 7/20/2026 |
| 2.0.0-prerelease.27 | 66 | 7/20/2026 |
| 2.0.0-prerelease.26 | 70 | 7/20/2026 |
| 2.0.0-prerelease.25 | 71 | 7/20/2026 |
| 2.0.0-prerelease.23 | 76 | 7/20/2026 |
| 2.0.0-prerelease.22 | 75 | 7/19/2026 |
| 2.0.0-prerelease.21 | 95 | 6/26/2026 |
| 2.0.0-prerelease.20 | 87 | 6/26/2026 |
| 2.0.0-prerelease.19 | 91 | 6/26/2026 |
| 2.0.0-prerelease.18 | 91 | 6/25/2026 |