# ISqlPersistenceDiagnostics

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.isqlpersistencediagnostics/
> Summary: ISqlPersistenceDiagnostics: Defines optional diagnostics for the active SQL persistence provider.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Defines optional diagnostics for the active SQL persistence provider.

```csharp
public interface ISqlPersistenceDiagnostics
```

## Remarks

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.

Call this interface; the SQL provider package supplies the implementation, so do not
implement or replace it.

## Properties

### <a id="Tracon_ISqlPersistenceDiagnostics_ProviderName"></a> ProviderName

Gets the provider name, for example `PostgreSQL`.

```csharp
string ProviderName { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_ISqlPersistenceDiagnostics_GetSnapshotAsync_System_Threading_CancellationToken_"></a> GetSnapshotAsync\(CancellationToken\)

Reads the connection and migration status.

```csharp
ValueTask<SqlPersistenceDiagnosticsSnapshot> GetSnapshotAsync(CancellationToken cancellationToken = default)
```

#### Parameters

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[SqlPersistenceDiagnosticsSnapshot](/api/tracon.sqlpersistencediagnosticssnapshot/)\>

The current status.
