AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/persistence/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

SQL Persistence Upgrade Version 2 to 3

Component: Sql Persistence

Accessing business data

When accessing business data in Versions 2 and below, the SQL persistence session information was injected into the storage session state irrespective of the selected storage type. In Versions 3 and above, the SQL persistence session information will only be injected if the SQL persistence is used for either Sagas or the Outbox. If the SQL persistence is for one of those and another persistence is used for the other, then an exception will be thrown. For example, it is not possible to mix SQL persistence for Sagas with any other persistence for Outbox. The same applies for the inverse.

Variant renamed to Dialect

To more accurately reflect SQL vernacular "Variant" has been renamed to "Dialect":

// For Sql Persistence version 3.x
var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
persistence.SqlDialect<SqlDialect.MySql>();

// For Sql Persistence version 2.x
var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
persistence.SqlVariant(SqlVariant.MySql);

The SqlDialect method returns a typed settings instance that can be used to apply configuration specific to that dialect:

var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
var mySqlDialectSettings = persistence.SqlDialect<SqlDialect.MySql>();

Dialect selection made mandatory

Versions 2 and below defaulted to SQL Server when a call to SqlVariant was omitted. In Versions 3 and above a call to SqlDialect is mandatory.

Schema moved to SqlDialect

Schema configuration has been moved to extend the result of the SqlDialect method:

// For Sql Persistence version 3.x
var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
var dialect = persistence.SqlDialect<SqlDialect.MsSqlServer>();
dialect.Schema("MySchema");

// For Sql Persistence version 2.x
var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
persistence.Schema("MySchema");