Skip to content
Tracon

ISqlPersistenceDiagnostics

Namespace Tracon · Assembly Tracon.Abstractions.dll

Defines optional diagnostics for the active SQL persistence provider.

public interface ISqlPersistenceDiagnostics

Each Use* extension (UsePostgreSql, UseSqlServer, and UseSqlite) registers this interface with Replace. Diagnostics reflect the winner. Persistence is in memory when no provider registers it.

The check is a lightweight connection probe, similar to SELECT 1. It applies no migration and changes no data.

DI lifetime — singleton. Registered as a singleton with Replace by whichever SQL provider is active.

Gets the provider name, for example PostgreSQL.

string ProviderName { get; }

string

Reads the connection and migration status.

ValueTask<SqlPersistenceDiagnosticsSnapshot> GetSnapshotAsync(CancellationToken cancellationToken = default)

cancellationToken CancellationToken

The cancellation token.

ValueTask<SqlPersistenceDiagnosticsSnapshot>

The current status.