Class QueryRecord
- Namespace
- QueryGuard
- Assembly
- QueryGuard.Core.dll
One relational command observed inside a QueryGuardSession.
public sealed class QueryRecord
- Inheritance
-
QueryRecord
- Inherited Members
Remarks
What this type does not carry is as deliberate as what it does. There is no field
for a parameter value and no field for a connection string anywhere in the model, so no
reporter, present or future, can leak data that was never captured. Parameter
names are counted rather than stored, because the count is occasionally useful
evidence while the names are not worth the risk. See
docs/decisions/0004-parameter-privacy.md.
Records are immutable and carry a monotonic Sequence so that ordering is deterministic. Snapshot tests and CI output depend on two identical runs producing identical results.
Constructors
- QueryRecord(int, QueryCommandKind, QueryFingerprint, TimeSpan, DateTimeOffset, string?, int, bool, string?, IReadOnlyList<string>?, string?)
Initializes a new instance of the QueryRecord class.
Properties
- CommandSource
Gets the EF Core command source, or null when the provider did not report one.
- Duration
Gets how long the command took to execute, measured with a monotonic clock.
- FailureType
Gets the exception type name for a failed command, or null otherwise.
- Fingerprint
Gets the fingerprint of the normalized command text.
- IsFailed
Gets a value indicating whether the command completed by failing.
- IsRead
Gets a value indicating whether this command counts toward read-query budgets.
- Kind
Gets the kind of relational command.
- ParameterCount
Gets how many parameters the command declared. The names and values are not captured.
- Sequence
Gets the one-based position of this command within its session.
- StackTrace
Gets a filtered stack trace for the first occurrence of this fingerprint, or null when capture is disabled or this is not the first occurrence.
- StartedAt
Gets when the command started, in UTC.
- Tags
Gets the query tags recognized on this command.
Methods
- ToString()
Returns a string that represents the current object.