JasperFx/marten
50.7
Adequate · 21 September 2026
104.6k
lines of production code
C#
primary language
4
measurements over time
What this system is
Marten is a .NET document database and event store built on PostgreSQL, providing capabilities for storing and querying JSON documents alongside event-sourced aggregates. It features an asynchronous projection daemon for building read models, supports multi-tenancy with row-level security, and integrates with ASP.NET Core for streaming HTTP responses. The system also offers extensions for spatial queries, vector search, and integration with Entity Framework Core.
How it got here
2015–2020 — Native AOT support and LINQ overhaul
55 changes.
This period focused on modernizing the Marten codebase to support Native AOT and Ahead-of-Time compilation through source generation and reflection-free storage resolution. It also involved a comprehensive restructuring of the LINQ query provider to enable complex operations like GroupJoin and SelectMany, alongside significant improvements to the event store, bulk loading, and multi-tenancy infrastructure.
2021–2022 — Async daemon and streaming overhaul
62 changes.
This period focused on stabilizing the async projection daemon with per-tenant scoping, improved gap detection, and robust teardown handling, while introducing native HTTP JSON streaming capabilities in Marten.AspNetCore. The core library shifted System.Text.Json to the default serializer and added event upcasting and flat table projection features to support schema evolution and denormalized storage. Extensive test infrastructure modernization, including migration to xUnit v3 and async-first patterns, accompanied these functional changes.
2023–2024 — LINQ overhaul and daemon resilience
53 changes.
This period focused on a major overhaul of the LINQ query provider, introducing advanced capabilities for nested collections, full-text search, and complex operators while significantly expanding test coverage. Concurrently, the async projection daemon was hardened with improved health checks, safer caching mechanisms, and robust error handling to ensure reliable event processing across multi-tenant and distributed environments.
2025–2026 — AOT readiness and storage modernization
41 changes.
This period focused on modernizing Marten's internal storage mechanisms by replacing runtime Roslyn code generation with hand-written closed-shape hierarchies and introducing a new source generator for compiled queries. Significant effort was dedicated to ensuring Native AOT compatibility, expanding first-class Entity Framework Core integration, and enhancing the Async Daemon's reliability and test coverage.
Features
Add AspNetODataWithMarten example project
A new example project demonstrating an ASP.NET Core OData API integrated with Marten has been added. This includes a WeatherForecast controller that exposes document queries via OData, along with the necessary application startup configuration and launch settings to run the service.
src/AspNetODataWithMarten · high confidence
Add LINQ query support for last modified metadata
Users can now filter documents based on their last modified timestamp using the new \ModifiedSince\ and \ModifiedBefore\ extension methods in LINQ queries. This feature introduces a new \LastModified\ namespace containing the extension methods and their corresponding \IMethodCallParser\ implementations, which translate the method calls into SQL \WHERE\ clauses comparing against the \LastModified\ column.
src/Marten/Linq/LastModified · high confidence
Add integration testing examples for multiple databases and streaming
New example files demonstrate how to configure integration tests using Alba and xUnit v3, including a context for managing multiple Marten document stores and a streaming test scenario that verifies API responses against stored documents.
src/Marten.AspNetCore.Testing/Examples · high confidence
Added DCB load test harness comparing TagTables and HStore storage modes
A new load testing tool has been added to benchmark Marten's Event Store performance, specifically comparing the TagTables and HStore storage modes for DCB (Domain Context Binding). The tool pre-seeds a database with tagged events and runs benchmarks for write operations (QuickAppend with and without tags) and read operations (QueryByTagsAsync, EventsExistAsync, and FetchForWritingByTags). It outputs detailed performance metrics and a side-by-side comparison of the two storage modes to help users evaluate which mode offers better throughput and latency for their specific workload.
src/DcbLoadTest · high confidence
Added EventPublisher daemon for bulk event publishing and telemetry testing
Introduced a new console application in src/EventPublisher designed to continuously and bulk publish events to the database for daemon testing purposes. The tool configures OpenTelemetry for metrics and tracing, including a Prometheus exporter, and utilizes Marten's multi-tenancy support to publish events across multiple tenants. It features a background service that cleans existing data, spawns multiple publisher tasks to append events to streams, and displays real-time publishing status via a console-based status board.
src/EventPublisher · high confidence
Added EventSourceWorker sample application
A new sample application named EventSourceWorker has been added to demonstrate integrating Marten with .NET Core hosting. It includes a background worker service, command handlers for creating and ending trips using event streams, and configuration for inline projections and the asynchronous daemon.
src/EventSourceWorker · high confidence
Added F\# projection support and tests
Users can now author event projections in F\# by overriding the Evolve, EvolveAsync, and ApplyAsync methods, as F\# lacks partial classes and Roslyn source generators required for the conventional C\# Apply/Create conventions. This change introduces the FSharpProjections library with sample implementations (self-aggregating, single-stream, multi-stream, and event projections) and a corresponding test suite in EventSourcingTests/FSharp to verify these authoring paths work correctly.
src/EventSourcingTests/FSharp, src/FSharpProjections · high confidence
Added LINQ query support for filtering documents by creation time
Users can now filter documents based on their creation timestamp using the new \CreatedAtExtensions\ LINQ methods \CreatedSince\ and \CreatedBefore\. This change introduces the \CreatedAt\ namespace with corresponding parsers (\CreatedBeforeParser\, \CreatedSinceParser\) that translate these method calls into SQL queries against the \CreatedAtColumn\, enabling time-based document searches.
src/Marten/Linq/CreatedAt · high confidence
Added MartenBenchmarks project for performance testing
A new benchmarking project has been added to the repository to measure and track the performance of core Marten operations. This project utilizes BenchmarkDotNet to provide metrics for document actions (insertions and bulk loading), LINQ query execution (including compiled queries), and event appending. It includes specific model classes and infrastructure to facilitate these performance tests, allowing developers to validate optimizations and regression impacts.
src/MartenBenchmarks · high confidence
Added MemoryUsageChecker diagnostic tool
A new console application named MemoryUsageChecker has been added to the project. This tool is designed to monitor and display memory usage metrics, such as working set size and CPU time, while performing repeated database operations using Marten's lightweight sessions. It serves as a diagnostic utility for analyzing memory behavior during data persistence and querying workflows.
src/MemoryUsageChecker · high confidence
Added MultiDatabaseCommandLineRunner demo application
A new console application has been added to demonstrate how to configure and run Marten with multiple document stores within a single command-line interface. The program sets up a default multi-tenant store alongside a secondary store (IOtherStore) and registers specific document types and async projections, illustrating the integration of these components for command-line execution.
src/MultiDatabaseCommandLineRunner · high confidence
Added TeleHealth event-sourcing example with multi-stream projection
Added a new code sample in the TeleHealth test area that demonstrates event sourcing patterns, including domain models (Board, BoardAppointment, BoardProvider), event records (BoardOpened, BoardClosed, BoardFinished), and a BoardViewProjection. The projection uses MultiStreamProjection to aggregate events across multiple streams into a single view, illustrating how to group and apply events from different sources to maintain a consistent read model.
src/EventSourcingTests/Examples/TeleHealth · high confidence
Batched queries now support event store operations and eager loading (includes)
The batch querying API has been expanded to allow fetching event stream data alongside document queries in a single round-trip. Users can now use methods like FetchStream, FetchForWriting, and FetchLatest on the batched query's Events accessor, and can also use the Include() syntax to eagerly load related documents for queried entities, reducing the number of database calls required for complex reads.
src/Marten/Services/BatchQuerying · high confidence
Compile-time type discovery via source generation
Marten now includes a source generator (Marten.SourceGeneration) that discovers document, projection, and event types at compile time and emits a static manifest class (DiscoveredMartenTypes). This allows applications to bypass runtime assembly scanning on startup, improving cold-start performance and enabling Ahead-of-Time (AOT) compatibility by providing a deterministic list of types known to the store.
src/Marten · high confidence
Compiled queries now support pre-generated source code for Native AOT compatibility
Marten introduces a source-generator-based path for compiled queries, allowing them to be pre-compiled into static code that works with Native AOT and trimming. This change adds a new \CompiledQueryHandlerRegistry\ and \CompiledQueryHandlerDescriptor\ to store and retrieve these pre-generated handlers, replacing the previous runtime code generation (Roslyn emit) for supported scenarios. The system includes new internal classes like \ArrayParameterFinder\ and \SimpleParameterFinder\ to handle parameter binding statically, ensuring that compiled queries can be used in AOT-compiled applications without triggering reflection or dynamic code generation at runtime.
src/Marten/Internal/CompiledQueries · high confidence
Event Store Explorer gains projection replay and multi-tenant scoping capabilities
The Event Store Explorer now supports running projections against event sets via \RunProjectionAsync\ and \RunMultiStreamProjectionAsync\, allowing users to step through projection logic and inspect per-step state changes. It also introduces tenant-scoped reads for \ReadStreamAsync\ and \GetRecentStreamsAsync\, and enforces database-scoped isolation in multi-tenant environments by refusing ambiguous single-stream reads across databases while correctly merging listing results.
src/EventSourcingTests/Explorer · high confidence
Event upcasting API for schema migration
Marten now provides a built-in event upcasting mechanism to handle event schema versioning and migration. Users can register transformations via the \IEventStoreOptions.Upcast\ method to map old event JSON payloads to new CLR types. The API supports both synchronous and asynchronous transformations, with specific \AsyncOnly\ variants that explicitly throw errors if invoked in a synchronous context, ensuring clear intent and preventing silent failures during event stream reading.
src/Marten/Services/Json/Transformations · high confidence
Expanded Include capabilities: compiled queries, custom mappings, and filtering
The Includes test suite has been significantly expanded to validate new and enhanced query features. Compiled queries now support the Include syntax, allowing included documents to be captured into list or dictionary properties directly within the compiled query object. The system also supports includes mapped on any property, enabling custom join conditions (e.g., mapping by string keys or non-standard ID fields) for one-to-one and one-to-many relationships. Additionally, users can now filter included documents using predicates, ensuring that only specific related records (e.g., those matching a color or status) are loaded alongside the parent query results.
src/LinqTests/Includes · high confidence
Expanded JSONB patching operations and NGram search capabilities
The database schema now includes a comprehensive set of new PL/pgSQL functions to support advanced JSONB patching and improved text search. Users can now perform atomic JSONB operations such as appending to arrays or objects (\mt\_jsonb\_append\, \mt\_jsonb\_append\_key\_value\), inserting at specific indices (\mt\_jsonb\_insert\), incrementing numeric values (\mt\_jsonb\_increment\), moving or duplicating fields (\mt\_jsonb\_move\, \mt\_jsonb\_duplicate\), and removing keys or values (\mt\_jsonb\_remove\, \mt\_jsonb\_remove\_key\). These are orchestrated by a central \mt\_jsonb\_patch\ function that handles complex patch sets. Additionally, NGram search functionality has been added via \mt\_grams\_array\, \mt\_grams\_query\, and \mt\_grams\_vector\ to generate unigrams, bigrams, and trigrams for better multi-term matching, with optional unaccent support. Helper functions for immutable date/time conversions and safe unaccenting are also included.
src/Marten/Schema/SQL · high confidence
Expanded LINQ query capabilities for child collections
This change introduces comprehensive support for querying nested child collections in LINQ expressions. Users can now use aggregate functions (Sum, Min, Max, Average) inside Where clauses, index into complex child collections (e.g., x.Lines\[0\].Name), and utilize new string operators like IsOneOf, IsNullOrEmpty, and IsNullOrWhiteSpace on collection elements. The underlying SQL generation has also been updated to use more efficient JSONPath strategies (such as jsonb\_path\_exists and NOT EXISTS) instead of the previous explode/ctid fallback, improving performance and reliability for complex nested queries.
src/LinqTests/ChildCollections · high confidence
Expanded LINQ string query support with case-insensitive and regex capabilities
The LINQ parser in the string methods location now supports a broader range of string operations, including case-insensitive comparisons (via \EqualsIgnoreCase\ and \StringComparison\ overloads), \Regex.IsMatch\ with optional case-insensitivity, and checks for null, empty, or whitespace-only strings (\IsNullOrEmpty\, \IsNullOrWhiteSpace\). These changes allow users to write more expressive and robust LINQ queries against string fields, with proper handling of reserved characters and JSON path translation for nested data.
src/Marten/Linq/Parsing/Methods/Strings · high confidence
First-class EF Core projections with atomic transaction participation
Marten now supports persisting event-projection aggregates directly into an EF Core DbContext instead of Marten's document storage. New base classes (EfCoreSingleStreamProjection, EfCoreMultiStreamProjection, EfCoreEventProjection) and extension methods (StoreOptions.Add) let you register projections that write to EF Core tables, which are automatically discovered and migrated via Weasel. Both Marten document writes and EF Core changes are committed atomically in the same database transaction through a new DbContextTransactionParticipant that swaps the DbContext to Marten's connection at commit time. The integration also fixes connection-leak bugs by releasing placeholder connections on disposal rather than only on the success path, and corrects schema handling so that EF Core entity tables are targeted during rebuild teardowns instead of the non-existent Marten document tables.
src/Marten.EntityFrameworkCore · high confidence
Improved LINQ support for Dictionary members
This change introduces a new set of LINQ query members for Dictionary properties, enabling more robust querying capabilities. Specifically, it adds support for checking if a dictionary is empty or not (\IsEmpty\, \NotEmpty\), counting the number of entries (\Count\), and accessing specific keys or values (\Keys\, \Values\). It also introduces a \ContainsKey\ filter to check for the existence of specific keys. These new members are implemented to generate efficient PostgreSQL JSONB queries, leveraging functions like \jsonb\_path\_query\_array\ and \jsonb\_array\_length\. The implementation also includes handling for nested properties and ensures proper escaping of single quotes in keys to prevent SQL injection.
src/Marten/Linq/Members/Dictionaries · high confidence
Initial documentation site and getting started guide
The documentation site has been seeded with a new layout, splash page, and a comprehensive getting started guide. The guide covers installing Marten via NuGet, Paket, or .NET CLI, and details bootstrapping a Document Store, integrating with IoC containers like Lamar, and configuring database creation. The site also includes a migration guide for version 3.0.0, highlighting changes such as the default schema creation mode shifting to CreateOrUpdate and updates to Enum and DateTime field storage behaviors.
documentation · high confidence
Introduce Marten.SourceGenerator for compiled queries
A new source generator project (Marten.SourceGenerator) has been added to replace runtime code generation for compiled queries. When a consumer assembly is marked with \[JasperFxAssembly\] and references the generator, it emits static handler classes that pre-classify query parameters, includes, and statistics, and bind them directly to Npgsql parameters without reflection or runtime Roslyn compilation. This provides an AOT-safe path for compiled queries, improving cold-start and steady-state performance while removing the dependency on JasperFx.RuntimeCompiler for these queries.
src/Marten.SourceGenerator · high confidence
Introduce OpenTelemetry tracing infrastructure
Added the MartenTracing class which exposes an ActivitySource named 'Marten' and helper methods to start connection and general activities, enabling OpenTelemetry integration for tracing Marten operations.
src/Marten/Internal/OpenTelemetry · high confidence
Introduce closed-shape document storage to replace runtime code generation
Marten now uses a new closed-shape document storage implementation (located in src/Marten/Internal/ClosedShape) to handle document persistence, replacing the previous Roslyn-based runtime code generation path. This change introduces a suite of new classes—including ClosedShapeBulkLoader, DocumentStorageDescriptorBuilder, and concurrency-mode-specific storage classes (Lightweight, IdentityMap, DirtyChecked)—that construct document storage providers and SQL operations at runtime from a DocumentStorageDescriptor. Users benefit from faster application startup times and reduced memory overhead, as the system no longer emits and compiles dynamic assemblies for each document type. The new implementation supports all existing document features, including versioning, concurrency modes, hierarchical mappings, and strong-typed identifiers, while maintaining full compatibility with the existing API surface through the ClosedShapeRegistration helpers.
src/Marten/Internal/ClosedShape · high confidence
Introduction of the IBulkLoader interface for bulk loading operations
The Marten library introduces the IBulkLoader\<T\> interface within the Marten.Schema.BulkLoading namespace to standardize and internalize bulk loading capabilities. This interface defines the contract for bulk operations, including methods to load documents asynchronously into a database connection, create temporary tables for data staging, and manage duplicate handling strategies such as ignoring duplicates, overwriting them, or overwriting with version checks. This change provides a structured API for implementing efficient bulk insert and update workflows.
src/Marten/Schema/BulkLoading · high confidence
IssueService demo app adds streaming and ETag integration endpoints
The IssueService sample application now includes a full set of Minimal API endpoints demonstrating Marten's streaming capabilities, including StreamOne, StreamMany, StreamPaged, StreamPagedByCursor, StreamAggregate, and StreamEventState. These endpoints exercise key behavioral features such as ETag derivation from numeric revisions, support for string-based stream identities, and the ability to opt out of ETag emission. The service is configured to use lightweight sessions and registers inline projections for Order and NamedOrder, providing a concrete reference for how these streaming and caching behaviors are wired in a real ASP.NET Core application.
src/IssueService · high confidence
Keyset-paginated raw JSON streaming via ToJsonPageByCursorAsync
Marten now supports keyset (seek) pagination for Linq queries that return raw JSON, accessible via the new ToJsonPageByCursorAsync extension method. This allows applications to fetch pages of documents as raw JSON strings using an opaque continuation cursor instead of offset-based Skip/Take, ensuring constant-time pagination performance regardless of result set depth. The implementation requires an OrderBy/ThenBy chain where the final ordering clause targets a unique member (typically the document ID) to guarantee deterministic results, and returns a CursorPageResult containing the raw JSON array, item count, and the next cursor token.
src/Marten/Linq/CursorPaging · high confidence
Major LINQ operator overhaul with new search, join, and ordering capabilities
The LINQ parsing engine has been refactored to support a broader range of query patterns and search relevance features. Users can now perform cross-document joins using GroupJoin, group results with GroupBy, and filter distinct items by a key selector using DistinctBy (translating to PostgreSQL DISTINCT ON). Full-text search is enhanced with OrderByNgramRank and OrderByTextRank operators for relevance-sorted results, while OrderBySql and ThenBySql allow custom literal SQL in ordering. The engine also hoists Where clauses following Select expressions to improve query composition, supports ordering by dictionary indexers, and enables case-insensitive string comparisons in OrderBy. Additionally, Last and LastOrDefault are now explicitly unsupported with clear error messages.
src/Marten/Linq/Parsing/Operators · high confidence
Major LINQ provider overhaul with new GroupJoin, GroupBy, and SelectMany support
The LINQ query parser has been significantly restructured and expanded to support complex query patterns. New parsers (GroupBySelectParser, JoinSelectParser) enable LINQ GroupBy and GroupJoin/SelectMany operations, including scalar projections and cross-document joins. The SelectParser now translates simple projections to server-side jsonb\_build\_object for better performance and streamability, while falling back to client-side evaluation for complex expressions. Additional improvements include F\# option unwrapping, CompareTo support, JSONPath creation for patching predicates, and performance optimizations via thread-static MemberFinder pooling and GenericFactoryCache for handler building.
src/Marten/Linq/Parsing · high confidence
Marten.PgVector 9.36 introduces hybrid search and adopts shared vector contracts
This release adds hybrid search capabilities, combining keyword (full-text) and vector similarity results using Reciprocal Rank Fusion (RRF) via the new HybridSearchAsync extension methods. The package now adopts the shared vector search contracts from JasperFx.Events.Vectors, unifying the DistanceFunction enum and IEmbeddingProvider interface across the Critter Stack (Marten, Polecat, Fisher) to ensure consistent behavior and allow store-agnostic code. To maintain backward compatibility, the previous Marten-specific API surface is preserved in LegacyApi.cs and marked obsolete, with automatic conversion between legacy and shared types. Additionally, VectorProjection now supports conjoined tenancy by including tenant\_id in its primary key and ensures embedding writes are transactionally consistent with the session.
src/Marten.PgVector · high confidence
Native AOT support and secondary store proxy improvements
This change introduces a registry-based storage resolution mechanism (DocumentStorageResolvers) to eliminate runtime code generation for document storage lookups, enabling Native AOT compatibility by avoiding MakeGenericType and Activator.CreateInstance on user types. It also refactors the secondary store configuration to use a thread-safe, reflection-emitted proxy factory (SecondaryStoreProxyFactory) that replaces the previous Roslyn-based code generation path, and adds a shared memory stream manager (SharedMemoryStreamManager) to pool streams via RecyclableMemoryStreamManager for reduced allocation overhead.
src/Marten/Internal · high confidence
Native AOT support for LINQ containment payloads and query planning
Marten now supports Native AOT for LINQ queries by introducing a dedicated \JsonbPayload\ writer that serializes containment and JSONPath filter payloads using \System.Text.Json\ directly, bypassing the consumer's serializer to avoid trimming issues. The \CollectionUsage\ class has been refactored into partial classes to handle statement compilation, include parsing, and expression parsing separately, while \MartenLinqQueryable\ now registers document storage resolvers at the generic entry point to ensure types are preserved for AOT. Additionally, query planning for compiled queries now honors the \\[MartenIgnore\]\ attribute, and the \QueryPlan\ output is deserialized directly via \System.Text.Json\ without routing through the user's serializer.
src/Marten/Linq · high confidence
New AspNetCoreWithMarten sample application
A new sample application has been added to demonstrate integrating Marten with ASP.NET Core. It includes a \Program.cs\ showing service registration with Marten and JasperFx extensions, along with example controllers and models for handling issues and users, illustrating document storage, querying, and JSON streaming capabilities.
src/AspNetCoreWithMarten · high confidence
New CommandLineRunner sample project for async daemon and code generation
A new CommandLineRunner project has been added to demonstrate configuring and running the async projection daemon in both Solo and Hot/Cold modes, including error handling and diagnostics. It also illustrates how to opt into the Marten.SourceGenerator for compiled queries via the \[JasperFxAssembly\] attribute and shows how to register multiple document stores and pre-built types.
src/CommandLineRunner · high confidence
New Flat Table Projections for event-driven document storage
Marten now supports Flat Table Projections, a new capability that allows event data to be written directly to a single, denormalized database table. This feature introduces the \FlatTableProjection\ class and a fluent API (\Project\<T\>\, \Increment\, \Decrement\, \SetValue\) to map event members to table columns, handling schema creation, upsert functions, and parameter binding automatically. It supports various column types, including value types and enums, and includes validation to ensure data integrity (e.g., preventing NOT NULL violations on partial mappings).
src/Marten/Events/Projections/Flattened · high confidence
New HTTP streaming result types for Marten.AspNetCore
This change introduces a suite of new Minimal-API / Wolverine.Http endpoint return types in the \Marten.AspNetCore\ namespace, enabling direct streaming of JSON to the HTTP response without deserialize/serialize round-trips. The new types include \StreamOne\<T\>\ and \StreamOneCompiled\ for single documents, \StreamMany\<T\>\ and \StreamManyCompiled\ for document arrays, \StreamPaged\<T\>\ for offset-based paged envelopes, and \StreamPagedByCursor\<T\>\ for keyset pagination with continuation cursors. For event sourcing, \StreamAggregate\<T\>\ streams the latest projected aggregate state, \StreamEvents\ streams raw event arrays, and \StreamEventState\ streams stream metadata. All types support configurable status codes, content types, and ETag emission (with \304 Not Modified\ support for \StreamOne\ and \StreamAggregate\), and automatically populate OpenAPI metadata for correct response documentation.
src/Marten.AspNetCore · high confidence
New IQueryable\<StreamState\> API for querying stream metadata
Users can now query stream state metadata (such as version, compacted version, and aggregate type) using a dedicated LINQ provider via \IReadOnlyEventStore.QueryStreamStates()\. This change introduces \StreamStateQueryable\, \StreamStateQueryProvider\, and \StreamStateSelector\ to translate LINQ expressions into SQL against the \mt\_streams\ table, enabling asynchronous filtering and ordering of stream metadata without loading full event data. A new \SingleEventQueryHandler\ is also added to support efficient single-event lookups by ID.
src/Marten/Events/Querying · high confidence
New JSON streaming and event projection endpoints in IssueService
Added new HTTP endpoints in the IssueService controllers that stream raw JSON directly to the HTTP response without deserializing or serializing the data in memory. This includes writing single documents by ID or via LINQ queries (IssueController), executing raw SQL queries returning JSON (JsonController), supporting strongly-typed identifiers for document retrieval (PaymentController), handling tenanted document queries (ThingController), and streaming the latest state of event-sourced aggregates (WriteLatestController).
src/IssueService/Controllers · high confidence
New LINQ Select() projection selectors for complex types and fallbacks
The Linq/Selectors area now includes dedicated selector implementations to support richer LINQ Select() projections. CastingSelector handles type casting during result resolution, NullableSelector manages nullable value types, and TimeSpanSelector enables projection of TimeSpan fields. Additionally, LambdaTransformSelector provides a fallback mechanism for complex Select() expressions (such as those involving method calls or arithmetic) by deserializing the source document and applying the lambda on the client side, ensuring these non-simple projections continue to work correctly.
src/Marten/Linq/Selectors · high confidence
New LINQ full-text search methods and NGram support
The LINQ provider now supports several new full-text search extension methods: Search, PlainTextSearch, PhraseSearch, WebStyleSearch, and PrefixSearch (which appends wildcards to words for prefix matching). Additionally, NgramSearch is available for n-gram based matching on string properties, with an optional unaccent transformation controlled by the store's Advanced.UseNGramSearchWithUnaccent setting. These methods parse into the corresponding PostgreSQL full-text functions and are restricted to string properties on document types.
src/Marten/Linq/Parsing/Methods/FullText · high confidence
New LINQ query filters for soft-deleted documents
Users can now filter soft-deleted documents using new LINQ extension methods: \IsDeleted\ and \IsNotDeleted\ to select by deletion status, and \DeletedSince\ and \DeletedBefore\ to filter by the deletion timestamp. These methods are parsed into specific SQL filters, enabling precise queries on the soft-delete state of documents.
src/Marten/Linq/SoftDeletes · high confidence
New and updated samples for event sourcing, projections, and Project Aspire integration
This update introduces several new sample projects and updates existing documentation samples to reflect the latest Marten and JasperFx.Events capabilities. The new AspireHeadlessTripService and AspireHost samples demonstrate how to integrate Marten with Project Aspire, including OpenTelemetry configuration for tracing and metrics. The EventSourcingIntro sample provides a complete event sourcing example using SingleStreamProjection with convention-based Apply methods, replacing the older ProjectEvent helpers. Documentation samples in DocSamples have been modernized to showcase the new projection registration syntax (Inline, Async, Live), snapshot lifecycles, and the new SingleStream/MultiStreamAggregation patterns. The MinimalAPI sample has been restored and updated to use the new JasperFx extensions and projection registration.
src/samples · high confidence
New composite, event, and multi-stream projection types with DI support
The projection subsystem introduces CompositeProjection to group multiple projections into a single execution unit with configurable stages, and adds DI-backed registration for custom projections via the IMartenRegistrable interface and CompositeProjectionWithServicesSource. EventProjection is now a dedicated abstract base class for flexible, 'do anything' projections that can declare custom schema objects, while MultiStreamProjection provides a typed base for aggregating events across multiple streams. These changes enable more modular projection composition, better integration with application IoC containers, and clearer separation of projection concerns.
src/Marten/Events/Projections · high confidence
New diagnostic, streaming, and observability capabilities in the Services layer
This change introduces several new capabilities to the \src/Marten/Services\ area. Users can now inspect and debug LINQ queries using the new \Diagnostics\ class, which provides methods to preview the generated SQL command (\PreviewCommand\) and retrieve the PostgreSQL EXPLAIN plan (\ExplainPlanAsync\). For high-throughput scenarios, \JsonStreamingExtensions\ adds raw JSON streaming support, including \StreamOneWithVersion\ for conditional requests (304 Not Modified) and \StreamCursorKeyset\ for efficient keyset pagination. Additionally, \OpenTelemetryOptions\ now allows users to opt-in to metrics tracking, specifically a histogram for \marten.fetch\_for\_writing.events\_replayed\ to monitor aggregate reconstruction costs, and counters for event appends. The \CommandRunnerExtensions\ also adds an \ExplainQueryAsync\ method for direct connection-level query planning.
src/Marten/Services · high confidence
New event appending performance harness
A new performance testing tool has been added to evaluate event store append modes. The harness includes a CLI interface to run benchmarks comparing baseline event appending against the new 'Quick' append mode, along with inline projections. It provides specific test plans for single-file simple appends, single-file fetch-for-writing, and multiple stream appends, allowing users to measure and compare throughput improvements.
src/EventAppenderPerfTester · high confidence
New event sourcing documentation samples
Added a comprehensive set of code samples in the EventSourcingTests/Examples directory to demonstrate key event sourcing capabilities, including bulk event appending with tenant and metadata support, configuring and reading live/inline/async aggregates, handling projection errors, skipping events, managing multi-tenancy with master tables, custom event naming styles, and performance optimizations like hot/cold storage partitioning and identity maps.
src/EventSourcingTests/Examples · high confidence
New extensions for TimescaleDB, PostGIS, and MemoryPack serialization
This release introduces three new extension packages. The Marten.TimescaleDB extension allows users to configure Marten-managed document and projection tables as TimescaleDB hypertables, enabling automatic chunking, compression, retention policies, and continuous aggregates. The Marten.PostGIS extension adds spatial query capabilities (nearest neighbor, distance filtering, containment, and intersection) for documents with geographic data, leveraging the NetTopologySuite. Additionally, the Marten.MemoryPack package provides a high-performance binary event serializer using MemoryPack, configurable via fluent API for both store-wide and per-type usage.
src · high confidence
New fluent patching API with conditional and dictionary operations
The patching API now supports conditional operations, allowing you to append items to collections or dictionaries only if they do not already exist using the new AppendIfNotExists methods. Additionally, dictionary patching is expanded with support for incrementing values and removing entries by key. These changes are implemented via the new PatchExpression and PatchOperation classes, which also introduce a Duplicate operation to copy field values to other locations within the same document.
src/Marten/Patching · high confidence
New high-water and async daemon health checks with staleness detection and auto-restart
Added two new health checks for the Marten Async Daemon: \AddMartenHighWaterHealthCheck\ detects when the high-water agent has stalled or died (independent of projection lag) and optionally auto-restarts the agent, while \AddMartenAsyncDaemonHealthCheck\ monitors async projection lag against the high-water mark. The high-water check supports scoping to specific databases via a provider-aware filter, handles multi-tenant and externally managed daemon modes, and uses poll-cycle age or sequence-gap heuristics to determine staleness. The async daemon check allows configuring maximum event lag and a time-based staleness window to avoid false positives during normal processing pauses.
src/Marten.AspNetCore/Daemon · high confidence
New identity generation strategies for strong-typed IDs and F\# discriminated unions
The identity generation subsystem in the Schema namespace has been restructured to introduce dedicated strategies for handling strong-typed identifiers and F\# discriminated unions. New classes such as ValueTypeIdGeneration and FSharpDiscriminatedUnionIdGeneration now allow documents to use non-nullable value type members and F\# single-case discriminated unions as document identifiers, resolving previous limitations where these types were either ignored or misclassified. Additionally, the system now correctly rejects multi-property value objects to prevent incorrect database type mappings, ensuring that LINQ resolution remains stable for documents using complex value types as properties.
src/Marten/Schema/Identity · high confidence
New live aggregation and bulk import capabilities for the Event Store
The Event Store now supports live aggregation of event queries directly into aggregate objects via the new AggregateToAsync and AggregateToManyAsync extension methods, allowing users to run LINQ queries against events and immediately materialize the resulting aggregates without relying on persisted projection views. Additionally, a new BulkEventAppender enables high-throughput, order-preserving bulk event imports using PostgreSQL COPY, which respects per-tenant sequence partitioning and supports preserving source sequence IDs for migration scenarios.
src/Marten/Events · high confidence
New sample code for ASP.NET Core DI and session configuration
Added new sample projects under src/AspNetCoreWithMarten/Samples demonstrating various ways to configure Marten in an ASP.NET Core application. These include registering Marten by connection string, using nested closure options, passing explicit StoreOptions, enabling eager initialization, and configuring lightweight sessions. Additionally, samples show how to implement custom session factories, including scoped factories that integrate with correlation IDs and custom logging via IMartenSessionLogger.
src/AspNetCoreWithMarten/Samples · high confidence
New scale-testing commands for daemon load, sharded tenancy, and multi-node failover
The Marten.ScaleTesting harness adds several new CLI subcommands to measure and validate projection daemon behavior under load. The \daemonload\ command measures steady-state connection footprints for a single database with partitioned tenants, while \daemonload\ with \--databases \> 1\ pools tenants across multiple shard databases to verify per-database connection governance. A new \dropcycle\ command exercises the end-to-end cleanup of tenant data, verifying that per-tenant sequences and progression rows are removed while preserving peer and store-global state. For multi-node scenarios, \daemonload-multinode\ launches multiple processes to test native HotCold leadership and failover, and \daemonload-multinode-sharded\ extends this to sharded tenancy, verifying cross-node leadership distribution and redistribution after node failure.
src/Marten.ScaleTesting · high confidence
New schema configuration attributes and database management components
This change introduces several new attributes and classes within the \Marten.Schema\ namespace to enhance document mapping and database management. Users can now use \DatabaseSchemaNameAttribute\ to override the database schema for a document type, \DdlTemplateAttribute\ to specify custom DDL templates, \DocumentAliasAttribute\ to define document aliases for schema disambiguation, and \DoNotPartitionAttribute\ to disable table partitioning for specific document types. Additionally, new classes like \ComputedIndex\ and \DocumentForeignKey\ provide more granular control over index generation and foreign key relationships, while \DatabaseGenerator\ and \DatabaseScopedTenantPartitions\ improve the handling of database creation and tenant partitioning in multi-database environments.
src/Marten/Schema · high confidence
New session factories for Identity and Dirty Tracked tracking modes
Added new internal session factories (IdentitySessionFactory, LightweightSessionFactory, and DirtyTrackedSessionFactory) that allow users to open sessions with specific change-tracking behaviors (IdentityOnly, None, or DirtyTracked) via a dedicated factory interface, providing more explicit control over session tracking modes compared to previous defaults.
src/Marten/Sessions · high confidence
New subscription registration API and documentation samples
The DaemonTests/Subscriptions area now includes new documentation samples (SubscriptionSamples.cs) and tests demonstrating the updated subscription registration API. Users can now register subscriptions using the simpler opts.Events.Subscribe() method for instances without service dependencies, or use the new AddSubscriptionWithServices() extension for subscriptions requiring dependency injection. The samples also illustrate configuration options such as SubscribeFromPresent, event filtering, and batch sizing, alongside error handling patterns like critical failure reporting and dead-lettering.
src/DaemonTests/Subscriptions · high confidence
New tenant-scoped deletion and custom SQL execution operations
Added DeleteAllForTenant, which emits a parameterized DELETE statement scoped to a specific tenant ID to support safe per-tenant projection teardown without affecting other tenants, and ExecuteSqlStorageOperation, which allows executing arbitrary SQL commands with custom parameter placeholders and values. These new internal storage operations complement the existing TruncateTable and the refactored StorageOperation base class, enabling more precise control over data modification and custom SQL execution within the session.
src/Marten/Internal/Operations · high confidence
NodaTime support now includes System.Text.Json serialization and LINQ query capabilities
The Marten.NodaTime plugin has been updated to support both Newtonsoft.Json and System.Text.Json serializers, allowing users to configure NodaTime mappings regardless of which JSON library they prefer. Additionally, LINQ queries can now directly reference NodaTime types such as Instant, ZonedDateTime, and LocalDate, with the plugin handling the necessary type mappings and immutable function wrappers for database indexes.
src/Marten.NodaTime · high confidence
Repository tooling and developer experience configuration
The repository now includes configuration files to standardize the development environment: \.gitattributes\ enforces consistent line endings and binary file handling, \.markdownlint.json\ and \.markdownlintrc\ configure markdown linting rules, \Analysis.Build.props\ adds threading and code analyzers, and \CLAUDE.md\ provides architectural patterns and coding conventions for AI-assisted development.
(repo-wide) · high confidence
Support for raw SQL and JSONPath in LINQ queries with customizable placeholders
Users can now filter documents using raw SQL fragments via the new \MatchesSql\ extension methods, which accept an \ISqlFragment\, a raw SQL string with parameters, or a raw SQL string with a custom parameter placeholder character. Additionally, a new \MatchesJsonPath\ method allows filtering using SQL that includes JSONPath operators, using the caret (\^\) character to distinguish parameter placeholders from JSONPath syntax. The implementation ensures that parameter types are correctly mapped to avoid runtime errors when passing non-string values.
src/Marten/Linq/MatchesSql · high confidence
System.Text.Json event upcasting with async support
Marten now provides dedicated System.Text.Json-based upcasters for event schema migration. Users can define transformations using raw JsonDocument payloads via the new EventUpcaster\<TEvent\> class for synchronous operations or AsyncOnlyEventUpcaster\<TEvent\> for asynchronous ones, registered through store options. The AsyncOnly variant explicitly throws an exception if invoked in a synchronous API context to prevent performance issues, while the synchronous variant allows standard JSON property access for efficient schema versioning without requiring old CLR types in the codebase.
src/Marten/Services/Json/Transformations/SystemTextJson · high confidence
Tenant-scoped event masking and overwrite capabilities
The event protection subsystem now supports masking and overwriting event data with strict tenant isolation. A new fluent API (EventDataMasking) allows users to select specific streams or filter events, apply masking, and persist changes via a lightweight session. Under the hood, the new OverwriteEventOperation and ReplaceEventOperation SQL commands include a conjoined tenant filter, ensuring that masked or replaced events are only updated within the calling tenant's partition and do not leak into other tenants' data.
src/Marten/Events/Protected · high confidence
Behavioural changes
Ability to override event metadata and track user information
Users can now customize specific metadata fields for individual events during append operations, including setting custom timestamps, event IDs, and user names. This change also enables the tracking of user name information in events via the LastModifiedBy property, allowing for more granular audit trails and event history control.
src/EventSourcingTests/Metadata · medium confidence
Archiving events no longer breaks on schema changes
The event archiving mechanism now explicitly names columns in its SQL operations, ensuring that archiving streams remains reliable even after the underlying event tables are altered (such as when new columns are added). This change prevents data misalignment errors that could occur when the physical order of columns in the database diverges from the order expected by the archiving function.
src/Marten/Events/Archiving · high confidence
Assembly visibility configuration for Marten and related projects
The Marten assembly now explicitly exposes its internals to a comprehensive set of related projects, including the main testing suites (CoreTests, LinqTests, DocumentDbTests, EventSourcingTests, etc.), specific integration packages (Marten.Newtonsoft, Marten.PgVector, Marten.PLv8, Marten.AspNetCore), and utility tools (Marten.CommandLine). This change ensures that internal types and members are accessible to these dependent assemblies, facilitating testing and cross-package functionality without requiring public API exposure.
src/Marten/Properties · high confidence
Baseline benchmark results added for bulk loading, document actions, event actions, and LINQ operations
New baseline benchmark reports have been added to the \benchmarks/2.0.baseline/results\ directory, providing performance metrics for bulk loading, document actions, event actions, and LINQ actions. These reports, generated using BenchmarkDotNet v0.10.1 on a Windows environment with an Intel Core i7-4980HQ CPU, include Markdown, CSV, and HTML formats. Key metrics captured include execution times and memory allocation for operations such as \BulkInsertDocuments\ (196.49 ms), \InsertDocuments\ (43.04 ms), \AppendEvents\ (44.33 ms), and LINQ operations like \RunLinqQuery\ (124.25 s) and \CompiledQueries\ (30.00 s).
benchmarks/2.0.baseline · high confidence
Centralized type aliases for lifted JasperFx and Weasel dependencies
A new shared file, DedupeAliases.cs, has been added to src/Shared to provide global using aliases for types that have been moved to external libraries (JasperFx, Weasel.Core, Weasel.Storage, and JasperFx.Events). This change allows existing code to continue compiling without requiring widespread namespace updates, while also introducing support for ILongVersioned (long) alongside the existing IRevisioned (int) for document versioning, and aliasing various storage, tenancy, metadata, and sequence-related types to their new canonical locations.
src/Shared · high confidence
Documentation site receives visual and navigation overhaul
The documentation website has been seeded with a new visual theme and improved navigation. This includes the addition of a fixed sidebar for easier content browsing, smooth scrolling between sections, and a refreshed Bootstrap-based design. The site now also features updated graphics, a Twitter follow button, and corrected image paths on the cover page.
documentation/content · high confidence
Enhanced LINQ support for value collections
This change improves how Marten translates LINQ queries against value collections (arrays/lists). It introduces new internal members to handle array indexing and element access, enabling more complex queries. Specifically, it adds support for querying by array index values, improves SelectMany() operations on value collections, and extends JSONPath strategies to handle string methods, complex-element Contains(), and general All() predicates. It also fixes issues with enum value-collection filters and dictionary LINQ queries.
src/Marten/Linq/Members/ValueCollections · high confidence
Event model name resolution moved to StoreOptions with service-name fallback
The event model name is no longer passed as a parameter during registration; instead, it is read from StoreOptions.EventModelName. If that is not explicitly set, the system defaults to the host's service name (e.g., from JasperFxOptions) rather than a hardcoded literal, preventing duplicate model conflicts in common Wolverine-based hosts. This change restores binary compatibility by removing the optional eventModelName parameter from AddMarten/AddMartenStore overloads and ensures the name is resolved at assembly time, allowing AddEventModel calls to occur before or after AddMarten without ordering issues.
src/Marten/Events/EventModeling · high confidence
Extract Newtonsoft.Json integration into a standalone Marten.Newtonsoft package
The Newtonsoft.Json serialization support has been extracted from the core Marten library into a new, separate \Marten.Newtonsoft\ package. This change decouples the dependency, meaning users who do not use Newtonsoft.Json no longer need to reference it. To use Newtonsoft.Json, you must now add the \Marten.Newtonsoft\ package and call \UseNewtonsoftForSerialization()\ on your \StoreOptions\. This package also includes specific fixes for Newtonsoft, such as handling lazy LINQ sequences to prevent unreadable documents and honoring \\[JsonProperty\]\ attributes in LINQ queries.
src/Marten.Newtonsoft · high confidence
Fixes projection scenario wipe for composite projections and improves test daemon responsiveness
The test harness for event projections now correctly cleans up data when using composite projections by leveraging PublishedTypes instead of StorageTypes, preventing leftover documents from previous scenarios. Additionally, the scenario now directly signals the projection daemon upon committing events, eliminating the previous 1-second polling delay and making test runs significantly faster.
src/Marten/Events/TestSupport · high confidence
Flat table projections now handle partial event mappings and complex types correctly
The FlatTableProjection implementation has been updated to support more robust event mapping scenarios. It now correctly handles partial mappings where an event only updates a subset of table columns, generating UPDATE-only statements to avoid violating NOT NULL constraints on columns not populated by that specific event. Additionally, the projection now properly honors enum storage settings (storing enums as strings or integers based on configuration), supports nullable enums, and automatically unwraps registered value types and nullable value types to their inner primitives for storage.
src/EventSourcingTests/Projections/Flattened · high confidence
Flexible document metadata columns and revision support
The document storage layer now supports flexible metadata columns, allowing users to capture causation and correlation IDs, track the user or process that last modified a document, and store custom user-defined headers. Additionally, the revision metadata column has been widened from a 32-bit integer to a 64-bit long to support larger version counts, while maintaining backward compatibility for existing integer-based revisions.
src/Marten/Storage/Metadata · high confidence
Hi-Lo identity generation refactored to use shared Weasel core
The Hi-Lo sequence implementation has been consolidated to use the shared \Weasel.Core.Sequences.HiloSequenceBase\ for client-side arithmetic and state management, with Marten's \HiloSequence\ now handling only the PostgreSQL-specific I/O (the \mt\_get\_next\_hi\ function and \mt\_hilo\ table updates). This change introduces a new \SequenceFactory\ that implements \ISequences\ and \IFeatureSchema\ to manage the \mt\_hilo\ table and function schema objects, and updates the identity generation interfaces (\ISequences\, \HiloIdGeneration\, \IdentityKeyGeneration\) to align with the new \Weasel.Core.Identity\ family. Users benefit from reduced code duplication and a more standardized approach to sequence-based identity generation that is consistent with other Weasel-managed features.
src/Marten/Schema/Identity/Sequences · high confidence
Improved daemon resiliency and error visibility for event projections
The event projection daemon now provides better visibility and handling of failures. When persisting a dead letter event fails (e.g., due to a missing table or connection issue), the error is logged instead of being silently swallowed, allowing operators to detect issues. Additionally, the daemon now correctly throws an exception if an invalid storage object is passed to the dead letter storage method, rather than failing silently. New capabilities include reading dead letter counts per projection and shard, and configurable defaults that allow skipping apply, serialization, and unknown event errors during continuous projection builds.
src/DaemonTests/Resiliency · high confidence
Improved high-water gap detection and resilience
The high-water detector now uses a dedicated GapDetector to identify and handle sequence gaps more accurately, preventing the high-water mark from advancing over uncommitted or rolled-back events. A new GapLivenessProbe checks for active transactions that might fill a gap, using an allocation fence to rule out idle sessions that could otherwise block progress indefinitely. The detector also persists stale-gap observations and allocation fences to survive restarts, ensuring that gaps are skipped only after a configurable threshold. Additionally, the PostgresqlListenWakeup now falls back to a timeout wait if the database is unreachable, preventing the daemon from freezing.
src/Marten/Events/Daemon/HighWater · high confidence
Improved reliability and operational safety for DCB tag operations
This update addresses several issues in the Domain Consistency Boundary (DCB) tag system. It fixes a race condition where concurrent appends to the same tag boundary could result in multiple commits instead of exactly one, ensuring strict serialization. It also resolves a bug where fetching a pure boundary aggregate would incorrectly register a document mapping, causing subsequent schema operations to fail. Additionally, the system now correctly handles multiple tags of the same type in bulk appends and allows the HStore tag index to be built out-of-band to avoid write locks during migration. Finally, tag types are now automatically discovered from projections, reducing manual configuration.
src/EventSourcingTests/Dcb · high confidence
Introduce closed-shape event storage to replace code generation
Marten now uses a hand-written, non-codegen event storage hierarchy (ClosedShapeEventDocumentStorage) for the Postgres event store, replacing the previous runtime Roslyn-emitted storage classes. This change introduces a new dialect-neutral storage layer in Weasel.Storage and a Postgres-specific dialect implementation, supporting Rich, Quick, and QuickWithServerTimestamps append modes. Users benefit from faster startup times due to the removal of runtime code generation, while the event storage behavior remains consistent with previous versions. The new architecture is opt-in in Marten 9 via StoreOptions.Events.UseClosedShapeStorage and is planned to be the default in version 10.
src/Marten/EventStorage · high confidence
Introduction of MartenIgnoreAttribute for code generation control
A new public MartenIgnoreAttribute has been added to the code generation pipeline, allowing users to explicitly exclude specific methods, fields, or properties from Marten's event handling code generation. This attribute inherits from JasperFxIgnoreAttribute and provides a mechanism to prevent certain members from being processed during compilation, addressing issues where automatic code generation might incorrectly include or handle specific class members.
src/Marten/Events/CodeGeneration · high confidence
Major LINQ query translation overhaul for collections and value types
This change replaces the legacy explode/CTE fallback with a correlated EXISTS strategy for child collection queries, significantly improving performance and composition at any nesting depth. It introduces native support for translating Count(predicate) over child collections directly into Select() projections, and enables aggregate functions (Sum, Min, Max, Average) over collections inside Where() clauses. The update also adds specific LINQ support for F\# options, improves querying for value types and duplicated array fields, and ensures DateTimeOffset comparisons are universally timed to avoid timezone-related inconsistencies.
src/Marten/Linq/Members · high confidence
Migrate LinqTests to xunit v3 and stabilize execution
The LinqTests project has been migrated to xunit v3, which required replacing the previous test framework initialization with a module initializer in TestSetup.cs to configure the serializer factory. To address test stability in CI, parallelization has been disabled globally via AssemblyInfo.cs, and the test suite has been updated to use asynchronous save operations and lightweight sessions instead of synchronous APIs. Additionally, new test coverage has been added for soft-delete queries with multiple where clauses and for LINQ patterns involving string.ToLower().IsOneOf().
src/LinqTests · high confidence
Migrate build system to Nuke with supervised test retries
The build infrastructure has been migrated to Nuke, replacing previous scripts. Test execution now uses Bobcat's Supervisor to run tests in fresh processes, enabling automatic retries for flaky tests and providing detailed visibility into test stability via a retry ledger and CI annotations.
build · high confidence
Migrate test suite to xUnit v3 and update test infrastructure
The DocumentDbTests project has been migrated to xUnit v3, requiring a shift from the previous xUnit v2 test framework extensibility model to a module initializer approach for configuring the JSON serializer. This change includes replacing custom exception assertion helpers with Shouldly, refactoring tests to use file-scoped namespaces, and removing obsolete Synchronous IO APIs. Additionally, the test suite now explicitly targets Newtonsoft.Json for dynamic type serialization scenarios, as System.Text.Json does not support dynamic member access, and integrates with Marten's source generator for compiled query type scanning.
src/DocumentDbTests · high confidence
Multi-stream projection tests now use JasperFx.Events abstractions
The test suite for multi-stream projections has been updated to use the new JasperFx.Events types (such as IEvent\<T\>) instead of the previous Marten-specific event abstractions. This change introduces new test scenarios, including a time-based monthly account activity projection and a roll-up projection by tenant ID (supporting both string and strong-typed tenant identifiers), while also adding support for multi-target identity rules where a single event applies to multiple aggregates.
src/EventSourcingTests/Projections/MultiStreamProjections · high confidence
New LINQ SQL generation filters for collection and tenant queries
The \src/Marten/Linq/SqlGeneration/Filters\ directory now contains a comprehensive set of new SQL generation filters that handle complex LINQ query patterns. These include \CollectionIsEmpty\ and \CollectionIsNotEmpty\ for checking collection presence via JSONPath, \DeepCollectionIsEmpty\ and \DeepCollectionIsNotEmpty\ for nested collection checks, and \ExistsCollectionFilter\ for correlated EXISTS queries on child collections. Tenant filtering is now handled by dedicated filters like \CurrentTenantFilter\, \SpecificTenantFilter\, and \TenantIsOneOfFilter\, while \ByIdFilter\ and its variants (\ByGuidFilter\, \ByStringFilter\, etc.) provide optimized document ID lookups. Additional filters like \AllValuesAreNullFilter\, \AllValuesEqualFilter\, \BooleanFieldIsTrue/False\, and \FullTextWhereFragment\ support advanced data validation and search capabilities within the LINQ provider.
src/Marten/Linq/SqlGeneration/Filters · high confidence
New async projection side-effect model and ancillary store enrichment
The event aggregation layer now supports a new async projection side-effect model, introducing thread-safe message batching and outbox mechanisms to ensure side effects are committed reliably within the same transaction as the events that produced them. Additionally, users can now enrich projections with data from an ancillary Marten store via the new \UsingStore\ extension, which resolves the store lazily to prevent dependency-injection deadlocks during projection construction.
src/Marten/Events/Aggregation · high confidence
New connection lifetime implementations and session internals for Marten 9.0
The session layer in src/Marten/Internal/Sessions has been restructured with the introduction of new connection lifetime classes—AmbientTransactionLifetime, AutoClosingLifetime, and EventTracingConnectionLifetime—to manage database connections, transactions, and OpenTelemetry tracing more explicitly. DocumentSessionBase has been refactored to rely on a new IWorkTracker (UnitOfWork) for managing pending operations, and its behavior is now split across specialized partial classes (Deletes, HardDeletes, ProjectionStorage, SaveChanges, etc.). This includes new methods for hard deletes, soft-delete undoing, and DCB (Distributed Concurrency Boundaries) boundary tracking, as well as a new DirtyCheckingDocumentSession for optimized dirty tracking.
src/Marten/Internal/Sessions · high confidence
New event-store schema objects for binary payloads, DCB concurrency, and progression tracking
The event store schema now includes a new \bdata\ (bytea) column alongside the existing \data\ (jsonb) column to support binary event serialization, allowing applications to opt into binary formats while maintaining backward compatibility with JSON rows. A new \mt\_dcb\_tag\_version\ side-table has been added to serialize Dynamic Consistency Boundary (DCB) tag-boundary checks, preventing race conditions during concurrent appends. Additionally, the \mt\_event\_progression\ table has been expanded with columns for agent health monitoring (heartbeat, agent\_status, pause\_reason, failure details) and a new \mt\_high\_water\_skips\ table is introduced to track high-water mark progression gaps, improving daemon reliability and observability.
src/Marten/Events/Schema · high confidence
New metadata marker interfaces and policy implementations for tenancy, soft deletes, tracking, and versioning
The \src/Marten/Metadata\ area now introduces a set of marker interfaces (\ITenanted\, \ISoftDeleted\, \ITracked\, \IVersioned\, \IRevisioned\, \ILongVersioned\) and corresponding internal policies (\TenancyPolicy\, \SoftDeletedPolicy\, \TrackedPolicy\, \VersionedPolicy\) that automatically configure document mappings when these interfaces are implemented. \ITenanted\ now derives from \JasperFx.MultiTenancy.ITenanted\ to enable conjoined tenancy across the JasperFx ecosystem. The \VersionedPolicy\ handles versioning strategies: \IRevisioned\ uses an integer column to maintain V8 compatibility, \ILongVersioned\ supports 64-bit revisions for multi-stream projections, and \IVersioned\ enables optimistic concurrency. Additionally, \SoftDeletedPolicy\ automatically enables soft-delete metadata fields, and \TrackedPolicy\ enables causation, correlation, and last-modified-by tracking.
src/Marten/Metadata · high confidence
Optimized async projection rebuilds via binary COPY and adaptive event loading
The async daemon now uses PostgreSQL's binary COPY protocol to flush document inserts during rebuilds, significantly speeding up initial projection population when the target table is truncated beforehand. This is supported by an adaptive EventLoader that falls back to skip-ahead or window-step strategies if the primary event query times out, and by per-tenant partitioning that ensures rebuilds only scan the relevant tenant's events. Additionally, user-code LoadAsync calls inside projections are routed through a projection-safe path to prevent connection leaks and concurrency issues.
src/Marten/Events/Daemon/Internals · high confidence
Overhauled LINQ method parsing for collections, containment, and tenant filters
The LINQ parsing logic in the \src/Marten/Linq/Parsing/Methods\ directory has been significantly restructured to improve support for collection queries and containment checks. New parsers have been introduced to handle \All\, \Any\, \IsEmpty\, \IsOneOf\, \IsNotOneOf\, \IsSubsetOf\, and \IsSupersetOf\ operations, including specific handling for \HashSet\ and \MemoryExtensions\ (span) \Contains\ calls. The changes also add support for tenant-specific filtering via \AnyTenant\ and \TenantIsOneOf\, and refine enum handling in \IsOneOf\ to ensure values are rendered according to the active serializer's storage format.
src/Marten/Linq/Parsing/Methods · high confidence
Pagination API refactored with new PagedList model and async-first design
The pagination system in \src/Marten/Pagination\ has been restructured to introduce a new \IPagedList\<T\>\ interface and \PagedList\<T\>\ implementation, replacing older patterns. Synchronous query methods are now removed (throwing \NotSupportedException\), enforcing an async-first approach via \ToPagedListAsync\ and \AsPagedListAsync\ extension methods. The new implementation supports a \useCountQuery\ option to fetch the total count via a separate query rather than relying on database statistics, and includes proper cancellation token support throughout the async pipeline.
src/Marten/Pagination · high confidence
Performance optimizations and safer retry logic in database command execution
This update introduces several internal improvements to the Marten database interaction layer. It adds compiled-delegate caching for generic method invocations and nullable strong-typed ID unwrapping to reduce reflection overhead during LINQ query execution. It also implements a stricter retry policy for write operations, ensuring that non-idempotent event appends are only retried when the transaction outcome is known to be rolled back, preventing duplicate events. Additionally, SQL generation now correctly applies table aliases to the data column in WHERE clauses and safely removes aliases from metadata columns using regex.
src/Marten/Util · high confidence
Projection rebuild teardown now correctly handles external storage and per-tenant scoping
The async daemon's projection rebuild process now distinguishes between data stored in Marten's document tables and data managed by external providers (such as EF Core). When tearing down a projection, the daemon skips truncating tables for projections that use custom storage providers, preventing errors or silent data loss. Additionally, a new per-tenant teardown path ensures that rebuilds only wipe data for the specific tenant being rebuilt, preventing cross-tenant data corruption in multi-tenant configurations.
src/Marten/Events/Daemon · high confidence
Re-engineered Include() processing with filtering and dictionary support
The Include() LINQ operations have been re-engineered to support filtering included documents via a new Where clause on the include plan, allowing users to limit which related documents are fetched. The implementation now supports mapping includes to dictionaries (both single and list-valued) and handles complex identity mappings between source and included documents. Internally, this is achieved through a new set of interfaces (IIncludePlan, IIncludeReader) and classes that process include queries using temporary tables and lateral joins, ensuring correct behavior with paging and Select() projections.
src/Marten/Linq/Includes · high confidence
Refactored FetchForWriting and FetchLatest into lifecycle-specific plans with safe aggregate caching
The Fetching subsystem has been restructured to use distinct \FetchAsyncPlan\ and \FetchInlinedPlan\ classes, separating the execution logic for asynchronous and inline projection lifecycles. This change introduces a safe caching mechanism for \FetchForWriting\: for inline aggregates, snapshots are now deferred to a post-commit listener (\AggregateWriteCacheListener\) to prevent data poisoning during rollbacks, while async plans handle caching directly. The refactoring also adds support for strong-typed identifiers, natural keys, and an opt-in identity map optimization for inline aggregates, ensuring that \FetchForWriting\ and \FetchLatest\ behave correctly across different tenancy and projection configurations.
src/Marten/Events/Fetching · high confidence
Refactored LINQ SQL generation with new SelectClause and Statement types
The LINQ query subsystem has been refactored to use a new set of internal classes for SQL generation, including AnySelectClause, CountClause, CursorKeySelectClause, DataSelectClause, Deletion, DistinctSelectionStatement, ExplodeCollectionStatement, FilterStatement, FromFragment, HardDelete, IParameterBearingSelectClause, IScalarSelectClause, ISelectClause, JoinSelectClause, LambdaSelectClause, Literal, NewScalarSelectClause, NewScalarStringSelectClause, OrderByFragment, ScalarClassSelectClause, ScalarSelectClause, ScalarStringSelectClause, and SelectDataSelectClause. This change introduces specific handling for various query types (e.g., Any, Count, Distinct, Scalar projections) and improves the structure of the SQL generation pipeline, particularly for complex scenarios like cursor-based paging, joins, and client-side projections.
src/Marten/Linq/SqlGeneration · high confidence
Refactored LINQ query execution to use a unified async IQueryHandler interface
The LINQ query execution pipeline has been restructured to route all queries through a new \IQueryHandler\ interface, replacing the previous synchronous or ad-hoc execution models. This change introduces dedicated handler classes for specific query patterns—including \ListQueryHandler\, \OneResultHandler\, \LoadByIdHandler\, \AdvancedSqlQueryHandler\, and \UserSuppliedQueryHandler\—ensuring consistent asynchronous processing and proper resource management. The refactoring also adds support for named parameters in raw SQL queries via \NamedParameterHelper\, allowing anonymous objects to be passed as parameters while correctly inferring Npgsql data types, and introduces \CheckExistsByIdHandler\ for efficient existence checks.
src/Marten/Linq/QueryHandlers · high confidence
Refactored async daemon coordination to leverage JasperFx.Events abstractions
The projection coordinator logic has been restructured to delegate core leadership election and agent lifecycle management to JasperFx.Events, with Marten now providing the specific distributor and settings via base constructors. This change introduces new \ExplicitProjectionCoordinator\ and \ProjectionCoordinator\ classes that manage daemon caching and resolution, while \ProjectionSet\ now implements the \IProjectionSet\ interface to bridge Marten's database and shard models with the shared daemon contracts. Users benefit from improved robustness in daemon distribution across tenants and databases, as well as cleaner shutdown behavior that prevents connection leaks when the host is disposed without a graceful stop.
src/Marten/Events/Daemon/Coordination · high confidence
Refactored async daemon progress tracking with per-tenant scoping and extended health monitoring
The event projection progress tracking in the async daemon has been rewritten to support per-tenant event partitioning, where shard identities now include tenant IDs to scope progress rows correctly without a dedicated tenant column. The system now tracks extended health metrics—including heartbeat, agent status, pause reasons, and failure classifications—allowing operators to monitor shard health and diagnose failures more effectively. Additionally, the \last\_updated\ timestamp is now refreshed on every progress write to prevent it from appearing frozen during active processing, and the high-water mark logic has been adjusted to exclude internal bookkeeping rows from projection shard reports.
src/Marten/Events/Daemon/Progress · high confidence
Refactored bulk loading to use async code generation and tenant-aware identity assignment
The bulk loading mechanism in the code generation layer has been refactored to support asynchronous operations and improved multi-tenancy handling. The new \BulkLoader\ base class now uses \BeginBinaryImportAsync\ for database imports and explicitly assigns document identities using the tenant's ID and database context during the load process. Additionally, a \SubClassBulkLoader\ was introduced to handle inheritance scenarios by delegating to a root bulk loader, ensuring that polymorphic documents are correctly processed.
src/Marten/Internal/CodeGeneration · high confidence
Refactored document storage hierarchy to neutralize database dependencies and improve multi-tenancy
The internal document storage implementation has been restructured to separate database-agnostic logic from Postgres-specific details. The base \DocumentStorage\ class no longer retains a reference to \DocumentMapping\, instead extracting necessary configuration (such as schema table details, delete styles, and metadata columns) during construction. A new \IStorageDialect\ strategy (implemented by \PostgresStorageDialect\) handles all Npgsql command building, parameter typing, and error code interpretation, allowing the storage hierarchy to remain database-neutral. Additionally, a new \ISharedTenantNeutralSessionState\ seam enables nested \ForTenant()\ sessions to share identity map and version state with their parent session for single document types, improving consistency in multi-tenant scenarios.
src/Marten/Internal/Storage · high confidence
Refactored event append and tagging operations for conjoined tenancy and DCB support
The event storage operations in this namespace have been reorganized to support conjoined tenancy, Dynamic Consistency Boundaries (DCB), and the new Quick Append mode. Legacy base classes for stream and event operations are now marked obsolete, superseded by Weasel implementations, to prepare for Marten 10. New operations handle retroactive tag assignment, DCB tag version bumping, and surplus tag insertion for bulk appends. Stream versioning and natural key claims now correctly scope operations to the calling tenant in conjoined setups, and the tombstone stream establishment is made tenant-aware. Additionally, the notification operation for event appends was fixed to prevent reader advancement issues with inline projections.
src/Marten/Events/Operations · high confidence
Refactored storage layer with new tenancy and bulk insertion models
The storage subsystem has been restructured to support advanced multi-tenancy and improved performance. A new \ITenancy\ interface and \DefaultTenancy\ implementation centralize tenant and database management, while \CompositeDocumentCleaner\ enables coordinated cleanup across multiple databases. Bulk operations are now handled by a dedicated \BulkInsertion\ class that supports tenant-aware Row Level Security and transaction enlistment. Additionally, document table schemas have been updated to enforce specific primary key ordering for conjoined tenancy and to shorten constraint names to prevent PostgreSQL identifier collisions.
src/Marten/Storage · high confidence
Refactored upsert function arguments into dedicated schema argument classes
The upsert function parameter definitions have been reorganized into a dedicated \Marten.Schema.Arguments\ namespace, introducing specific classes such as \CurrentVersionArgument\, \DocJsonBodyArgument\, \ExpectedVersionArgument\, and \RevisionArgument\ (including a 32-bit integer variant for \IRevisioned\ documents). This change centralizes the metadata for upsert parameters—including their PostgreSQL types, database types, and column mappings—within the \UpsertArgument\ base class, improving the structure of the schema generation logic.
src/Marten/Schema/Arguments · high confidence
Standardized exception hierarchy and improved error reporting
Marten now uses a unified \MartenException\ base class for all library exceptions, replacing the previous inconsistent hierarchy. This change introduces specific, descriptive exception types (such as \AmbiguousFullTextIndexException\, \DocumentIdTypeMismatchException\, and \InvalidDateTimeUsageException\) to provide clearer context on failures. Additionally, \MartenCommandException\ has been enhanced to automatically capture and report the failing SQL command text, even within batched writes, significantly simplifying the debugging of database errors.
src/Marten/Exceptions · high confidence
StressTests project added to CI with parallelism fixes and test stabilization
The StressTests suite is now included in the CI pipeline, revealing and fixing pre-existing test instability. To prevent race conditions caused by shared database state and concurrent execution, test parallelization is disabled at the assembly level via CollectionBehavior. The test suite has been migrated to xunit v3, and synchronous SaveChanges calls have been replaced with asynchronous equivalents to align with modern API usage. Additionally, new tests have been added to verify database creation with maintenance NpgsqlDataSources and to ensure correct behavior when enlisting sessions in ambient transaction scopes.
src/StressTests · high confidence
System.Text.Json becomes the default JSON serializer
Marten now uses System.Text.Json as the default serialization engine for storing and querying documents, replacing the previous default. Newtonsoft.Json support is no longer included in the core library; users who require it must explicitly add the separate Marten.Newtonsoft package and configure it via StoreOptions. The new System.Text.Json implementation includes built-in converters for BigInteger and dynamic types to maintain compatibility with existing data patterns.
src/Marten/Services/Json · high confidence
Test harness reorganization and random seed isolation
The test suite has been reorganized to improve stability and isolation. The \Target\ document generator now uses \Random.Shared\ instead of a shared static \Random\ instance to prevent thread-safety issues during parallel test execution, with a \\[ThreadStatic\]\ seed overlay available for deterministic tests. Additionally, the \CodeTracker\ sample data generator has been imported into the testing project, and the \AssemblyInfo\ now explicitly disables test parallelization for the \Marten.Testing\ assembly to prevent interference between test classes.
src/Marten.Testing · high confidence
Updated 1.3 benchmark reports for bulk loading, document actions, event actions, and LINQ
The benchmark reports in the benchmarks/1.3 directory have been refreshed to reflect post-optimization performance data. New and updated reports for BulkLoading, DocumentActions, EventActions, and LinqActions now include specific metrics such as execution time, memory allocation, and garbage collection generation counts (Gen 0/Gen 1) for operations like BulkInsertDocuments, InsertDocuments, AppendEvents, CreateLinqCommand, RunLinqQuery, and CompiledQueries.
benchmarks/1.3 · high confidence
Updated internal assembly visibility for testing and examples
The Marten.AspNetCore library now explicitly exposes its internal members to a broader set of test assemblies (including DaemonTests, ConfigurationTests, CoreTests, DocumentDbTests, EventSourcingTests) and the Examples project via InternalsVisibleTo attributes. This change supports internal testing and example code access without altering public API behavior.
src/Marten.AspNetCore/Properties · high confidence
Weighted full-text search with unambiguous index resolution and relevance ranking
Full-text search now supports weighted indexing, allowing specific document fields to be assigned relevance weights (A–D) so that matches in high-priority fields rank higher than others. To ensure correctness, the system now strictly refuses ambiguous index selection when multiple indexes share the same text search configuration, throwing an error instead of silently picking one. Additionally, search results can be ordered by relevance using a parameterized \ts\_rank\ pipeline that guarantees the ranking vector matches the filter vector, and the system will now warn when a search falls back to an unindexed, slow whole-document scan.
src/Marten/Schema/Indexing/FullText · high confidence
Fixes
Daemon high-water mark no longer stalls behind idle advisory-lock sessions
The HotCold daemon now correctly advances its high-water mark past dead sequence gaps even when slow, idle-in-transaction sessions (such as those holding advisory locks) are present. Previously, these idle sessions could cause the gap-liveness probe to incorrectly assume the gap was still being filled, stalling the daemon indefinitely. This fix ensures that projection processing continues smoothly during deployments, crashes, or when the daemon restarts against a store with existing gaps, preventing the system from hanging.
src/DaemonTests.ManualOnly/Coordination · high confidence
Fix for Scoped subscriptions losing configuration settings
Resolves an issue where subscriptions registered as Scoped services would silently drop configuration options (such as BatchSize, SubscribeFromPresent, Name, and Version) that were set in the subscription's constructor. The ScopedSubscriptionServiceWrapper now correctly propagates these settings from the inner subscription instance to the wrapper, ensuring that user-defined subscription behaviors are honored consistently regardless of the service lifetime.
src/Marten/Subscriptions · high confidence
Fix upcaster shadowing during typed event appends
Resolved a bug where registering an upcaster for an event type and then appending that event using its original CLR type caused the read path to bypass the upcaster, returning the old type instead of the new one. This ensures that schema migrations via upcasting work correctly even when new events are appended using the legacy type within the same store, while preserving the existing behavior for non-upcaster mapping swaps.
src/EventSourcingTests/SchemaChange · high confidence
Fixes race conditions in Dynamic Consistency Boundary (DCB) tag queries
Resolves concurrency issues in DCB tag-based cross-stream querying by replacing the previous racy SELECT-EXISTS checks with a robust side-table mechanism. The new implementation captures the DCB tag version at fetch time and enforces consistency at save time using row-level locks on the \mt\_dcb\_tag\_version\ table, ensuring that concurrent appends to the same tag boundaries serialize correctly without deadlocks. This change also introduces deterministic sorting of tag operations to prevent lock-ordering conflicts and supports both HStore-backed and multi-tag-type queries with proper JOIN handling.
src/Marten/Events/Dcb · high confidence
Test coverage
Add compiled query integration tests for diagnostics, string operations, and validation; Add multi-host PostgreSQL test infrastructure; Added AOT compatibility smoke test for Marten; Added EventStoreMigrations test utility for appending events; Added F\# type definitions and expression helpers for testing; Added JavaScript unit tests for the Marten PLV8 patching API; Added configuration tests for document mapping, registry, and policies; Added diagnostics tests for Postgres version and store options inspection; Added integration tests for JSON reading and streaming operations; Added integration tests for document identity strategies; Added manual-only integration tests for Async Daemon and High Water health checks; Added modular composite configuration smoke tests for Marten projections; Added performance benchmark reports for version 1.2.5; Added regression tests for DocumentDb bug scenarios; Added regression tests for LINQ query behaviors; Added regression tests for async daemon projection bugs; Added regression tests for database configuration and schema migration edge cases; Added regression tests for event sourcing bug fixes; Added source-generator correctness and performance gates for compiled queries; Added test coverage for pgvector search, projections, and multi-tenancy; Added test fixtures for external fetch planners and cross-assembly document mapping; Added test for EventProjection global ordering; Added test for deserializing single-property records with NonPublicMembersStorage.All; Added tests for DefaultMartenLogger logging behavior; Added tests for EF Core integration stability and schema handling; Added tests for EventTracingConnectionLifetime; Added tests for Native AOT compatibility and async disposal stability; Added tests for PostgreSQL LISTEN/NOTIFY daemon wakeup and event type index; Added tests for TimescaleDB hypertable projections and document storage; Added tests for TruncateTable operation; Added tests for base event type hierarchies and static record snapshot application; Added tests for binary event serialization and mixed-format streams; Added tests for conjoined tenancy projections; Added tests for custom NpgsqlDataSourceFactory configuration; Added tests for document session loading behavior; Added tests for event schema upcasting with multiple versions and JSON serializers; Added tests for exception handling and event failure classification; Added tests for flat table projections with increment/decrement operations; Added tests for foreign key constraint enforcement and cascading deletes; Added tests for internal persistence graph and version tracker; Added tests for long (64-bit) versioned document concurrency; Added tests for modular composite configuration behavior; Added tests for reflection and string utility extensions; Added tests for strong typed identifiers and value type behaviors; Added tests for the compiled query source generator; Added unit tests for LINQ internals and query parsing; Batched querying tests migrated to xUnit v3 and async patterns; Composite projection regression tests and infrastructure fixes; Comprehensive LINQ acceptance test suite for query behaviors and edge cases; Comprehensive LINQ operator test coverage in src/LinqTests/Operators; Daemon tests now verify projection safety under parallel fan-out and extended-progression reliability; Enrolled comprehensive cross-store compliance test suites for Marten; Event sourcing test suite reorganized and stabilized for CI reliability; Expanded and corrected patching test coverage; Expanded test coverage for document hierarchy and interface-based storage; Expanded test coverage for tenant-partitioned event store admin and write paths; Foreign key configuration tests for multi-tenancy and ID references; Initial NodaTime integration tests; Integration test suite for Marten.AspNetCore streaming and result types; Marten test suite reorganized into xUnit v3 with async-first writing tests; Migrate sequence identity tests to xUnit v3 and async patterns; Native AOT runtime smoke test for document and event reads; New Quick Append event modes with metadata support; New TeleHealth event projection test suite; New and updated tests for advanced indexing capabilities; New example code for document commit listeners, environment checks, initial data, and multiple stores; New integration tests for document and event metadata features; New multi-tenancy test suite for sharded, per-database, and partitioned stores; New multi-tenancy test suite with partitioning and row-level security support; New test coverage for advanced SQL, cursor paging, and query plans; New test coverage for multi-stream projection grouping patterns; New test harness and helpers for event sourcing aggregation; New test suite for DocumentSession mechanics and change tracking; New test suite for daemon internals covering high-water detection, event loading, and projection teardown; New test suite for document deletion behaviors and soft-delete configuration; New test support infrastructure for DaemonTests; New tests for dynamic multi-tenant daemon and cross-tenant event subscriptions; New utility for async multi-action test assertions; Refactored LINQ acceptance test infrastructure for isolation and reliability; Test harness now correctly wipes composite projections and commits trailing actions; Test suite for container-scoped projections with IoC dependencies; Test suite for partitioning receives regression and security coverage; Test suite reorganization and migration to xUnit v3; Test suite reorganized for new projection APIs and validation behavior; Tests added for BatchFlushMode classification and HighWater shard identity naming; Tests for FetchForWriting consistency, caching, and multi-tenancy; Tests for closed-shape document storage identification and operations; Tests verify Extended Progression Tracking defaults and DI wiring.
Dependencies
Update mermaid from 11.6.0 to 11.15.0
The mermaid dependency used in the documentation site has been upgraded from version 11.6.0 to 11.15.0, bringing in the latest features and fixes for diagram rendering in the project's documentation.
(dependencies) · high confidence
Housekeeping
Added FastExpressionCompiler benchmark results; Benchmark results for Newtonsoft 10 upgrade.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 52 → 51 (-0.8)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 72 → 67 (-5.7)
- Architecture 87 → 87 (+0.3)
- Maturity 71 → 70 (-1.1)
- Readiness 50 → 53 (+3.3)
- Security 38 → 36 (-2.2)
- Domain Modelling 73 → 78 (+5.6)
- Event-Driven 100 → 100 (+0.0)
- Performance 72 → 72 (+0.0)
Resolved (147)
- BarePragmaDisable (src/Marten/Services/Json/SystemTextJsonExtensions.cs)
- BarePragmaDisable (src/Marten/Storage/MasterTableTenancy.cs)
- BarePragmaDisable (src/Marten/Storage/MasterTableTenancy.cs)
- BarePragmaDisable (src/Marten/Storage/MasterTableTenancy.cs)
- Boundary-crossing change coupling: StreamingMinimalEndpoints.cs ↔ MartenLinqQueryProvider.cs (src/IssueService/StreamingMinimalEndpoints.cs)
- Boundary-crossing change coupling: ValueTypeIdGeneration.cs ↔ TestingTypes.cs (src/Marten/Schema/Identity/ValueTypeIdGeneration.cs)
- Bounded contexts not declared
- Change coupling: DateTimeMember.cs ↔ ComputedIndex.cs (src/Marten/Linq/Members/DateTimeMember.cs)
- Change coupling: DateTimeMember.cs ↔ NgramIndex.cs (src/Marten/Linq/Members/DateTimeMember.cs)
- Change coupling: DocumentStorage.cs ↔ ValueTypeIdentifiedDocumentStorage.cs (src/Marten/Internal/Storage/DocumentStorage.cs)
- Change coupling: IEventStoreOptions.cs ↔ IReadOnlyEventStoreOptions.cs (src/Marten/Events/IEventStoreOptions.cs)
- Change coupling: QuickEventAppender.cs ↔ RichEventAppender.cs (src/Marten/Events/QuickEventAppender.cs)
- Change coupling: SubClassDocumentStorage.cs ↔ ValueTypeIdentifiedDocumentStorage.cs (src/Marten/Internal/Storage/SubClassDocumentStorage.cs)
- CompiledQueryPlan.sortMembers (cognitive 17) (src/Marten/Internal/CompiledQueries/CompiledQueryPlan.cs)
- Coverage not measured — no test passed in the analyzed run
- Duplicated block (10 lines × 2) (src/Marten/Events/Fetching/FetchAsyncPlan.ForReading.cs)
- Duplicated block (10 lines × 2) (src/Marten/Linq/SqlGeneration/SelectorStatement.cs)
- Duplicated block (10 lines × 2) (src/Marten/Patching/PatchExpression.cs)
- Duplicated block (10 lines × 2) (src/Marten/Services/BatchQuerying/BatchedQuery.Events.cs)
- Duplicated block (11 lines × 2) (src/Marten.EntityFrameworkCore/EfCoreMultiStreamProjection.cs)
- …and 127 more
New (674)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- …and 654 more
Changes since last survey
- 194 commits — 177 feature/other, 17 fixes
By area
- src/Marten — 58 commits
- (root) — 54 commits
- src/EventSourcingTests — 22 commits
- docs/events — 9 commits
- src/DaemonTests — 8 commits
- src/CoreTests — 7 commits
- src/Marten.PgVector — 7 commits
- docs/documents — 6 commits
- src/Marten.PgVector.Tests — 6 commits
- src/LinqTests — 3 commits
- src/Marten.Testing — 3 commits
- src/DocumentDbTests — 2 commits
- (repo) — 1 commit
- .github/workflows — 1 commit
- docs/cSpell.json — 1 commit
- docs/configuration — 1 commit
- docs/testing — 1 commit
- src/DaemonTests.ManualOnly — 1 commit
- src/IssueService — 1 commit
- src/Marten.AspNetCore — 1 commit
Notable commits
- fix: Fix #5159: make UseOptimisticConcurrency and UseNumericRevisions symmetric (#5218)
- fix: Fix #5210: UseListenNotifyForEventAppends breaks inline projections in the same transaction (#5214)
- fix: Fix #5328 — document reads work from a Native AOT binary (#5360)
- fix: Fix #5361: reduce an enum compared to a variable without Reflection.Emit (#5362)
- fix: Fix #5382 — tenant-less GetProjectionStatusesAsync answers from the registry on a database-per-tenant store (#5401)
- fix: Fix #5400 — the explorer read APIs must not provision a tenant or a database (#5402)
- fix: Fix enum value-collection filters broken by MemoryExtensions.Contains comparer overload and bare-parameter Any() (#5279)
- fix: Fix store level CompactStreamAsync throwing NullReferenceException (#5240)
- fix: Upgrade to Weasel 9.31.1 to fix the concurrent db-apply partition race (#5364) (#5367)
- fix: fix(#5109): make the stale-gap cap clock survive detector restarts (#5165)
- fix: fix(#5131): publish the cursor paged envelope as the 200 response type (#5202)
- fix: fix(#5161): ignore non-shard progression rows when waiting for non-stale data (#5164)
- fix: fix(#5192): bundle the JasperFx.Events.SourceGenerator 2.42.1 published-types fix (#5196)
- fix: fix(events): shorten the natural key table's primary key constraint name (#5271)
- fix: fix(schema): no mt_doc table for an EF Core projection's aggregate (#5351) (#5358)
- fix: fix: let HardDeleteWhere reach already soft-deleted rows (#5215)
- fix: marten#5305: regression guard for #4085, and the JasperFx bump it requires (#5306)
- change: #5213: audit that every NoDataReturnedCall really returns no result set (#5219)
- change: #5216: implement the JasperFx document persistence abstractions over Marten (#5221)
- change: #5239: the window-step loader must not claim a ceiling it never scanned (#5242)
- …and 174 more
API surface
- 1 added · 0 removed (a removed endpoint is potentially breaking)
Added endpoints (1)
- GET /minimal/issue/{id}/from-document-session
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
JasperFx/marten was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit cf27cd53f915643caa0bf3c9708ee57c18c320a2 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.