cfd403710e
Every HistoryUpdate a SQL backend applies now leaves a modification trail
(prior value, principal, Part 11 update type, modification time), and
HistoryReadRaw with IsReadModified=true serves it as HistoryModifiedData.
- Core: HistoryUpdateContext threaded into all three IHistorianDataUpdater
methods; IHistorianDataSource.ReadModifiedAsync (default NotSupported =>
BadHistoryOperationUnsupported on Gateway/Null); HistoryModified* contracts.
- SqlServer: schema v2 (002_sample_modified.sql, RequiredVersion=2, docs copy);
trail written by OUTPUT ... INTO on the same MERGE/DELETE statement, so a
failed update leaves no audit row; retention purges SampleModified per tag on
the source-time cutoff; ReadModifiedAsync keyed on (SourceTimeUtc, ModifiedId).
- QuestDB: append-only {prefix}sample_modified (TTL like samples), trail row
written BEFORE the change (orphan-on-crash, never an untracked change);
existence reads now carry the prior value; ReadModifiedAsync.
- Node manager: modified reads dispatch + page via the #669 continuation store
(HistoryContinuationState gains HistoryCursorKind + LastModifiedId), gated by
the existing HistoryRead decision; session principal / key id passed to the
updater. IsDeleteModified stays unsupported.
- Client.CLI: historyread --modified.
- Tests: node-manager dispatch/paging/cursor binding/principal threading,
over-the-wire HistoryModifiedData, shared ModifiedValueConformance on both
backends, SqlServer atomicity (forced trail failure => no change) + v1->v2
upgrade + retention trail purge.
- Docs: Historian.md (Modified-value history section, schema v2 upgrade note),
security.md, Client.CLI.md, CLAUDE.md.
63 lines
2.3 KiB
C#
63 lines
2.3 KiB
C#
using ZB.MOM.WW.OtOpcUa.Driver.Historian.Conformance;
|
|
using Xunit;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.QuestDb.IntegrationTests;
|
|
|
|
// One concrete subclass per conformance class: the suite's tests run here against QuestDB.
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbRawReadConformance(QuestDbFixture fx) : RawReadConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbAtTimeConformance(QuestDbFixture fx) : AtTimeConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbProcessedConformance(QuestDbFixture fx) : ProcessedConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbQualityContractConformance(QuestDbFixture fx) : QualityContractConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbLiveWriteConformance(QuestDbFixture fx) : LiveWriteConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbUpdateConformance(QuestDbFixture fx) : UpdateConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbTagNameConformance(QuestDbFixture fx) : TagNameConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|
|
|
|
[Collection(QuestDbCollection.Name)]
|
|
public sealed class QuestDbModifiedValueConformance(QuestDbFixture fx) : ModifiedValueConformance
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override Task<IConformanceBackend> CreateBackendAsync() => QuestDbConformanceBackend.CreateAsync(fx);
|
|
}
|