Table of Contents

Class QueryGuardResult

Namespace
QueryGuard
Assembly
QueryGuard.Core.dll

The immutable outcome of evaluating one completed session against its policy.

public sealed class QueryGuardResult
Inheritance
QueryGuardResult
Inherited Members

Remarks

This is the object every reporter serializes and every assertion inspects, so its ordering is deterministic: two identical runs produce identical output. Without that, snapshot tests are worthless and CI diffs become noise.

It is also already redacted. The central privacy policy runs before a result is constructed, so a reporter cannot leak anything by accident and adding a new reporter cannot introduce a leak. See docs/decisions/0004-parameter-privacy.md.

Constructors

QueryGuardResult(string, Guid, string, DateTimeOffset, TimeSpan, IReadOnlyList<QueryRecord>, IReadOnlyList<QueryFingerprintGroup>, IReadOnlyList<QueryFinding>)

Initializes a new instance of the QueryGuardResult class.

Properties

Elapsed

Gets how long the session was open. This is wall-clock time for the request or test, not database time: compare it against TotalDatabaseDuration.

FailureCount

Gets the number of findings that cause this result to fail.

Findings

Gets the findings, ordered by descending severity and then by rule name.

Groups

Gets the fingerprint groups, ordered by descending occurrence count so the most repeated query is first.

IgnoredFindingCount

Gets the number of findings suppressed by an allowlist entry.

IsSuccess

Gets a value indicating whether the session satisfied its policy.

PolicyName

Gets the name of the policy the session was evaluated against.

ReadCommandCount

Gets the number of captured read commands, meaning reader and scalar commands.

Records

Gets every captured command, ordered by sequence number.

SessionId

Gets the identifier of the session that was evaluated.

SessionName

Gets the name of the session that was evaluated, such as a route pattern or a test name.

StartedAt

Gets when the session opened, in UTC.

TopRepeatedGroup

Gets the fingerprint group with the most occurrences, or null when no commands were captured.

TotalCommandCount

Gets the total number of captured commands, of every kind.

TotalDatabaseDuration

Gets the summed duration of every captured command.

WarningCount

Gets the number of warning findings that were not ignored.

Methods

ToString()

Returns a string that represents the current object.