Marten 9.52.0 adds projection start floors and exception transforms
Marten 9.52.0, the PostgreSQL-based document and event store for .NET, adds a new schema table, an exception transform option and several tenant removal fixes. Anyone upgrading should know how the schema migration affects their databases before deploying.
Key points
- The new mt_event_projection_floors table is created for every event store on its next schema apply.
- AsyncOptions.SubscribeFromFirstRun() relies on the persisted projection start floors stored in that table.
- StoreOptions.Advanced.ExceptionTransforms maps your own SQLSTATE codes to typed exceptions, checked before the built-in ones.
- UndeleteDocumentAsync restores a soft-deleted document; document pages can be ordered newest first.
- Permanent database errors in projection code now report ShardFailureCategory.ApplyEvent with the event name; they are still not dead-lettered.
- Tenant removal under UseTenantPartitionedEvents no longer fails with 23503 when DCB tag rows or natural-key aggregates exist.
Marten 9.52.0, the PostgreSQL-based document and event store for .NET, is out and built on JasperFx 2.93.1. The main schema change is a new mt_event_projection_floors table, which each event store receives as a migration on its next apply. It stores the start floors that the new AsyncOptions.SubscribeFromFirstRun() option relies on. Databases not yet migrated keep their current projection start behaviour.
The release also adds StoreOptions.Advanced.ExceptionTransforms, which lets applications map their own PostgresException SQLSTATE codes to typed exceptions before Marten's built-in transforms run. Document diagnostics gain UndeleteDocumentAsync, and projection errors now name the event that caused a permanent database failure. Tenant removal failures under UseTenantPartitionedEvents are fixed too.
Real-world use
- A multi-tenant SaaS app that stores events with per-tenant partitioning and removes tenants over time
- A PostgreSQL-backed service that wants custom SQLSTATE codes mapped to its own exception types
- An admin tool that restores soft-deleted documents or lists them newest first
Why it matters
Teams upgrading Marten should check the new table and schema migration in a test database first. Tenant removal fixes matter most for projects using partitioned events.