feat(historian): SQL Server retention purge (RetentionDays, Primary-gated, applock) (#667)

This commit is contained in:
Joseph Doherty
2026-10-11 08:21:30 -04:00
parent db6a53036b
commit 924eff8d3c
13 changed files with 602 additions and 2 deletions
@@ -96,5 +96,14 @@ public sealed class SqlServerHistorianProvider : IHistorianBackendProvider
return new SqlServerHistorianDataUpdater(s.Conn, s.Catalog);
}
/// <inheritdoc />
public IHistorianRetention? CreateRetention(IServiceProvider sp)
{
if (_options.RetentionDays is not { } days) return null;
var s = Get(sp);
return new SqlServerHistorianRetention(s.Conn, s.Bootstrap, _options.PurgeInterval, days,
_options.PurgeBatchSize, Loggers(sp).CreateLogger<SqlServerHistorianRetention>());
}
private sealed record Shared(SqlHistorianConnection Conn, SqlServerSchemaBootstrapper Bootstrap, SqlServerTagCatalog Catalog);
}