Class AuditQueryService

Assembly: redb.Tsak.Core.dll

Reads and prunes tsak_audit_log. Raw ADO.NET on purpose — the table is flat,
append-only and provider-specific, so going through redb would buy nothing and cost the
PVT round-trip on every filter.

All filtering and paging happens server-side; nothing is materialised and filtered in
memory. Every parameter is bound through with an explicit
type: timestamps as the column's own type per provider, and null filters as typed nulls, which
is what keeps the (@x IS NULL OR col = @x) shape parseable on PostgreSQL.


Several Tsak clusters may share the database: reads and the retention sweep see this node's
cluster (Tsak:Cluster:ClusterName) plus the entries written before cluster isolation.

public sealed class AuditQueryService

Inheritance

Object→AuditQueryService

Properties

IsAvailable

True when the audit table exists and can be queried.

public bool IsAvailable { get; }

Provider

Provider Tsak is configured with; means no database.

public AuditProvider Provider { get; }

Methods

PruneAsync(DateTimeOffset, CancellationToken)

Deletes entries older than the cutoff. Returns the number of rows removed.

public Task<int> PruneAsync(DateTimeOffset cutoff, CancellationToken ct = default)

QueryAsync(string?, string?, string?, DateTimeOffset?, DateTimeOffset?, int, int, CancellationToken)

Newest-first page of audit entries matching the (all optional) filters.

public Task<AuditQueryResult> QueryAsync(string? actor = null, string? action = null, string? target = null, DateTimeOffset? since = null, DateTimeOffset? until = null, int limit = 100, int offset = 0, CancellationToken ct = default)

Constructors