IDataSubjectStore
AgentPrism.Abstractions.dllThe data plane that counts, exports, and erases one data subject’s content across the schema.
public interface IDataSubjectStoreRemarks
Section titled “Remarks”The default (in-memory) setup registers NullDataSubjectStore, which
always returns an empty result: export and erasure are meaningful only when a
SQL provider is enabled — the same precedent as IRetentionStore
and its NullRetentionStore.
Methods
Section titled “Methods”EraseAsync(string, DataSubjectScope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>, CancellationToken)
Section titled “ EraseAsync(string, DataSubjectScope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>, CancellationToken)”Deletes a scope’s content.
ValueTask<IReadOnlyDictionary<string, int>> EraseAsync(string tenantId, DataSubjectScope scope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask> beforeCommitAsync, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant id.
scope DataSubjectScope
The subject’s scope.
beforeCommitAsync Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>
Runs after every delete has executed but BEFORE the change is committed. When it throws, every delete is rolled back and the exception propagates — That rule applied here: an erasure that cannot be written to the audit trail is not applied. The caller uses this to write the audit entry (which needs the row counts this method computes) while the erasure itself can still be undone if that write fails.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyDictionary<string, int>>
The row count actually deleted per target.
ExportAsync(string, DataSubjectScope, CancellationToken)
Section titled “ ExportAsync(string, DataSubjectScope, CancellationToken)”Reads every column of a scope’s content, target by target, as one export document.
ValueTask<DataSubjectExport> ExportAsync(string tenantId, DataSubjectScope scope, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant id.
scope DataSubjectScope
The subject’s scope.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The export document.
PreviewAsync(string, DataSubjectScope, CancellationToken)
Section titled “ PreviewAsync(string, DataSubjectScope, CancellationToken)”Counts the rows that would be deleted for a scope, by target, without deleting anything.
ValueTask<IReadOnlyDictionary<string, int>> PreviewAsync(string tenantId, DataSubjectScope scope, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant id.
scope DataSubjectScope
The subject’s scope.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyDictionary<string, int>>
The row count per target; a target with nothing to delete is present with the value 0.