Class QueryDefinition
Describes the shape of a QueryCommand: the projection/entity source, the condition,
joins, paging, ordering, grouping and logging. It groups the collaborators that used to travel as
a long constructor parameter list through QueryCommand,
QueryCommand<TResult> and CreateCommand.
public sealed record QueryDefinition : IEquatable<QueryDefinition>
- Inheritance
-
QueryDefinition
- Implements
- Inherited Members
- Extension Methods
Remarks
Immutable; use with to derive a variant (for example a re-ordered clone). Exactly one of
Exp or SrcType identifies the source: Exp is the
projection lambda for the generic command, SrcType the entity type when there is no
projection.
Properties
Condition
Optional predicate applied as a WHERE clause.
public LambdaExpression? Condition { get; init; }
Property Value
Exp
Projection lambda of the query, or null when SrcType is used.
public LambdaExpression? Exp { get; init; }
Property Value
Final
Whether the query carries the ClickHouse FINAL modifier.
public bool Final { get; init; }
Property Value
Group
Optional grouping lambda.
public LambdaExpression? Group { get; init; }
Property Value
GroupByWithTotals
Whether the grouping carries the WITH TOTALS modifier (ClickHouse).
public bool GroupByWithTotals { get; init; }
Property Value
Having
Optional HAVING lambda.
public LambdaExpression? Having { get; init; }
Property Value
IgnoreFilters
Whether the query disables any global query filter declared for its entity type, either through the all-or-nothing form or a selective NextORM.Core.QueryDefinition.FilterScope. Only a fallback for a definition that carries no NextORM.Core.QueryDefinition.FilterScope: with true it means every filter is disabled.
public bool IgnoreFilters { get; init; }
Property Value
IsDistinct
Whether the query was marked DISTINCT.
public bool IsDistinct { get; init; }
Property Value
Joins
Joins accumulated by the builder.
public JoinExpression[]? Joins { get; init; }
Property Value
Logger
Whether the projection was declared through SelectGroup, so the grouping keys are inferred
from the projection's scalar outputs instead of a Group lambda.
public ILogger? Logger { get; init; }
Property Value
Paging
Paging (limit/offset) applied to the query.
public Paging Paging { get; init; }
Property Value
PreWhere
Optional ClickHouse PREWHERE predicate.
public LambdaExpression? PreWhere { get; init; }
Property Value
SampleOffset
The ClickHouse SAMPLE ... OFFSET value; zero when absent.
public double SampleOffset { get; init; }
Property Value
SampleRatio
The ClickHouse SAMPLE ratio, or null when the modifier is absent.
public double? SampleRatio { get; init; }
Property Value
Settings
The trailing ClickHouse SETTINGS entries, or null when there are none.
public IReadOnlyList<KeyValuePair<string, string>>? Settings { get; init; }
Property Value
Sorting
Ordering accumulated by the builder.
public Sorting[]? Sorting { get; init; }
Property Value
- Sorting[]
SrcType
Entity type of the query when there is no projection lambda.
public Type? SrcType { get; init; }
Property Value
Windows
Named window definitions declared for this query (WINDOW w AS (...)), or null when
the query declares none. A dialect that does not support the clause rejects a query that carries
them.
public IReadOnlyList<WindowDefinition>? Windows { get; init; }
Property Value
Methods
ForEntity(Type)
Creates a definition whose source is the given entity type (no projection lambda).
public static QueryDefinition ForEntity(Type entityType)
Parameters
entityTypeType
Returns
ForProjection(LambdaExpression)
Creates a definition whose source is the given projection lambda.
public static QueryDefinition ForProjection(LambdaExpression exp)
Parameters
expLambdaExpression