Class SqlNodeExtensions
- Namespace
- LfrlAnvil.Sql.Expressions
- Assembly
- LfrlAnvil.Sql.Core.dll
Contains various extension methods related to SqlNodeBase type.
public static class SqlNodeExtensions
- Inheritance
-
SqlNodeExtensions
- Inherited Members
Methods
Abs(SqlExpressionNode)
Creates a new SqlAbsFunctionExpressionNode instance.
[Pure]
public static SqlAbsFunctionExpressionNode Abs(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the absolute value from.
Returns
- SqlAbsFunctionExpressionNode
New SqlAbsFunctionExpressionNode instance.
Add(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlAddExpressionNode instance.
[Pure]
public static SqlAddExpressionNode Add(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlAddExpressionNode
New SqlAddExpressionNode instance.
And(SqlConditionNode, SqlConditionNode)
Creates a new SqlAndConditionNode instance.
[Pure]
public static SqlAndConditionNode And(this SqlConditionNode node, SqlConditionNode right)
Parameters
node
SqlConditionNodeFirst operand.
right
SqlConditionNodeSecond operand.
Returns
- SqlAndConditionNode
New SqlAndConditionNode instance.
AndSet(SqlUpdateNode, params SqlValueAssignmentNode[])
Creates a new SqlUpdateNode instance by adding more Assignments.
[Pure]
public static SqlUpdateNode AndSet(this SqlUpdateNode node, params SqlValueAssignmentNode[] assignments)
Parameters
node
SqlUpdateNodeSource update node.
assignments
SqlValueAssignmentNode[]Collection of value assignments to add.
Returns
- SqlUpdateNode
New SqlUpdateNode instance.
AndSet(SqlUpdateNode, Func<SqlUpdateNode, IEnumerable<SqlValueAssignmentNode>>)
Creates a new SqlUpdateNode instance by adding more Assignments.
[Pure]
public static SqlUpdateNode AndSet(this SqlUpdateNode node, Func<SqlUpdateNode, IEnumerable<SqlValueAssignmentNode>> assignments)
Parameters
node
SqlUpdateNodeSource update node.
assignments
Func<SqlUpdateNode, IEnumerable<SqlValueAssignmentNode>>Collection of value assignments to add.
Returns
- SqlUpdateNode
New SqlUpdateNode instance.
AndWhere<TAggregateFunctionNode>(TAggregateFunctionNode, SqlConditionNode)
Decorates the provided SQL aggregate function node with an SqlFilterTraitNode with IsConjunction set to true.
[Pure]
public static TAggregateFunctionNode AndWhere<TAggregateFunctionNode>(this TAggregateFunctionNode node, SqlConditionNode filter) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
filter
SqlConditionNodeUnderlying predicate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
As(SqlConditionNode, string)
Creates a new SqlSelectFieldNode instance.
[Pure]
public static SqlSelectFieldNode As(this SqlConditionNode node, string alias)
Parameters
node
SqlConditionNodeSelected condition that will be converted to an expression.
alias
stringAlias of the selected expression.
Returns
- SqlSelectFieldNode
New SqlSelectFieldNode instance.
As(SqlExpressionNode, string)
Creates a new SqlSelectFieldNode instance.
[Pure]
public static SqlSelectFieldNode As(this SqlExpressionNode node, string alias)
Parameters
node
SqlExpressionNodeSelected expression.
alias
stringAlias of the selected expression.
Returns
- SqlSelectFieldNode
New SqlSelectFieldNode instance.
AsSelf(SqlDataFieldNode)
Creates a new SqlSelectFieldNode instance without an alias.
[Pure]
public static SqlSelectFieldNode AsSelf(this SqlDataFieldNode node)
Parameters
node
SqlDataFieldNodeSelected data field.
Returns
- SqlSelectFieldNode
New SqlSelectFieldNode instance.
AsSet(SqlNamedFunctionExpressionNode, string)
Creates a new SqlNamedFunctionRecordSetNode instance.
[Pure]
public static SqlNamedFunctionRecordSetNode AsSet(this SqlNamedFunctionExpressionNode node, string alias)
Parameters
node
SqlNamedFunctionExpressionNodeUnderlying SqlNamedFunctionExpressionNode instance.
alias
stringAlias of this record set.
Returns
- SqlNamedFunctionRecordSetNode
New SqlNamedFunctionRecordSetNode instance.
AsSet(SqlCreateTableNode, string?)
Creates a new SqlNewTableNode instance or returns created table's RecordSet
when provided alias
is null.
[Pure]
public static SqlNewTableNode AsSet(this SqlCreateTableNode node, string? alias = null)
Parameters
node
SqlCreateTableNodeUnderlying SqlCreateTableNode instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlNewTableNode
New SqlNewTableNode instance or created table's RecordSet when provided
alias
is null.
AsSet(SqlCreateViewNode, string?)
Creates a new SqlNewViewNode instance.
[Pure]
public static SqlNewViewNode AsSet(this SqlCreateViewNode node, string? alias = null)
Parameters
node
SqlCreateViewNodeUnderlying SqlCreateViewNode instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlNewViewNode
New SqlNewViewNode instance.
Asc(SqlExpressionNode)
Creates a new SqlOrderByNode instance with Asc ordering.
[Pure]
public static SqlOrderByNode Asc(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeUnderlying expression.
Returns
- SqlOrderByNode
New SqlOrderByNode instance.
Asc(SqlSelectNode)
Creates a new SqlOrderByNode instance with Asc ordering.
[Pure]
public static SqlOrderByNode Asc(this SqlSelectNode node)
Parameters
node
SqlSelectNodeUnderlying selection.
Returns
- SqlOrderByNode
New SqlOrderByNode instance.
Assign(SqlDataFieldNode, SqlExpressionNode)
Creates a new SqlValueAssignmentNode instance.
[Pure]
public static SqlValueAssignmentNode Assign(this SqlDataFieldNode node, SqlExpressionNode value)
Parameters
node
SqlDataFieldNodeData field to assign value to.
value
SqlExpressionNodeValue to assign.
Returns
- SqlValueAssignmentNode
New SqlValueAssignmentNode instance.
Average(SqlExpressionNode)
Creates a new SqlAverageAggregateFunctionExpressionNode instance.
[Pure]
public static SqlAverageAggregateFunctionExpressionNode Average(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the average value for.
Returns
BitwiseAnd(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseAndExpressionNode instance.
[Pure]
public static SqlBitwiseAndExpressionNode BitwiseAnd(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlBitwiseAndExpressionNode
New SqlBitwiseAndExpressionNode instance.
BitwiseLeftShift(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseLeftShiftExpressionNode instance.
[Pure]
public static SqlBitwiseLeftShiftExpressionNode BitwiseLeftShift(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
BitwiseNot(SqlExpressionNode)
Creates a new SqlBitwiseNotExpressionNode instance.
[Pure]
public static SqlBitwiseNotExpressionNode BitwiseNot(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeOperand.
Returns
- SqlBitwiseNotExpressionNode
New SqlBitwiseNotExpressionNode instance.
BitwiseOr(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseOrExpressionNode instance.
[Pure]
public static SqlBitwiseOrExpressionNode BitwiseOr(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlBitwiseOrExpressionNode
New SqlBitwiseOrExpressionNode instance.
BitwiseRightShift(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseRightShiftExpressionNode instance.
[Pure]
public static SqlBitwiseRightShiftExpressionNode BitwiseRightShift(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
BitwiseXor(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseXorExpressionNode instance.
[Pure]
public static SqlBitwiseXorExpressionNode BitwiseXor(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlBitwiseXorExpressionNode
New SqlBitwiseXorExpressionNode instance.
ByteLength(SqlExpressionNode)
Creates a new SqlByteLengthFunctionExpressionNode instance.
[Pure]
public static SqlByteLengthFunctionExpressionNode ByteLength(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate byte length from.
Returns
CastTo(SqlExpressionNode, ISqlColumnTypeDefinition)
Creates a new SqlTypeCastExpressionNode instance.
[Pure]
public static SqlTypeCastExpressionNode CastTo(this SqlExpressionNode node, ISqlColumnTypeDefinition typeDefinition)
Parameters
node
SqlExpressionNodeUnderlying value to cast to a different type.
typeDefinition
ISqlColumnTypeDefinitionISqlColumnTypeDefinition instance that defines the target type.
Returns
- SqlTypeCastExpressionNode
New SqlTypeCastExpressionNode instance.
CastTo(SqlExpressionNode, Type)
Creates a new SqlTypeCastExpressionNode instance.
[Pure]
public static SqlTypeCastExpressionNode CastTo(this SqlExpressionNode node, Type type)
Parameters
node
SqlExpressionNodeUnderlying value to cast to a different type.
type
TypeTarget runtime type.
Returns
- SqlTypeCastExpressionNode
New SqlTypeCastExpressionNode instance.
CastTo<T>(SqlExpressionNode)
Creates a new SqlTypeCastExpressionNode instance.
[Pure]
public static SqlTypeCastExpressionNode CastTo<T>(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeUnderlying value to cast to a different type.
Returns
- SqlTypeCastExpressionNode
New SqlTypeCastExpressionNode instance.
Type Parameters
T
Target runtime type.
Ceiling(SqlExpressionNode)
Creates a new SqlCeilingFunctionExpressionNode instance.
[Pure]
public static SqlCeilingFunctionExpressionNode Ceiling(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the ceiling value from.
Returns
Coalesce(SqlExpressionNode, params SqlExpressionNode[])
Creates a new SqlCoalesceFunctionExpressionNode instance.
[Pure]
public static SqlCoalesceFunctionExpressionNode Coalesce(this SqlExpressionNode node, params SqlExpressionNode[] other)
Parameters
node
SqlExpressionNodeFirst argument of the function.
other
SqlExpressionNode[]Collection of following function's arguments.
Returns
Concat(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlAddExpressionNode instance.
[Pure]
public static SqlConcatExpressionNode Concat(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlConcatExpressionNode
New SqlAddExpressionNode instance.
Count(SqlExpressionNode)
Creates a new SqlCountAggregateFunctionExpressionNode instance.
[Pure]
public static SqlCountAggregateFunctionExpressionNode Count(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the number of records for.
Returns
Cross(SqlRecordSetNode)
Creates a new SqlDataSourceJoinOnNode instance with Cross type.
[Pure]
public static SqlDataSourceJoinOnNode Cross(this SqlRecordSetNode node)
Parameters
node
SqlRecordSetNodeInner SqlRecordSetNode instance.
Returns
- SqlDataSourceJoinOnNode
New SqlDataSourceJoinOnNode instance.
Desc(SqlExpressionNode)
Creates a new SqlOrderByNode instance with Desc ordering.
[Pure]
public static SqlOrderByNode Desc(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeUnderlying expression.
Returns
- SqlOrderByNode
New SqlOrderByNode instance.
Desc(SqlSelectNode)
Creates a new SqlOrderByNode instance with Desc ordering.
[Pure]
public static SqlOrderByNode Desc(this SqlSelectNode node)
Parameters
node
SqlSelectNodeUnderlying selection.
Returns
- SqlOrderByNode
New SqlOrderByNode instance.
Distinct<TAggregateFunctionNode>(TAggregateFunctionNode)
Decorates the provided SQL aggregate function node with an SqlDistinctTraitNode.
[Pure]
public static TAggregateFunctionNode Distinct<TAggregateFunctionNode>(this TAggregateFunctionNode node) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
Divide(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlDivideExpressionNode instance.
[Pure]
public static SqlDivideExpressionNode Divide(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlDivideExpressionNode
New SqlDivideExpressionNode instance.
Escape(SqlLikeConditionNode, SqlExpressionNode)
Creates a new SqlLikeConditionNode instance with changed Escape.
[Pure]
public static SqlLikeConditionNode Escape(this SqlLikeConditionNode node, SqlExpressionNode escape)
Parameters
node
SqlLikeConditionNodeValue to check.
escape
SqlExpressionNodeEscape character for the pattern.
Returns
- SqlLikeConditionNode
New SqlLikeConditionNode instance.
Exists(SqlRecordSetNode)
Creates a new SqlExistsConditionNode instance.
[Pure]
public static SqlExistsConditionNode Exists(this SqlRecordSetNode node)
Parameters
node
SqlRecordSetNodeRecord set of the sub-query to check.
Returns
- SqlExistsConditionNode
New SqlExistsConditionNode instance.
ExtractDate(SqlExpressionNode)
Creates a new SqlExtractDateFunctionExpressionNode instance.
[Pure]
public static SqlExtractDateFunctionExpressionNode ExtractDate(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to extract date part from.
Returns
ExtractDayOfMonth(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfMonth(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to extract day of month component from.
Returns
ExtractDayOfWeek(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfWeek(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to extract day of week component from.
Returns
ExtractDayOfYear(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfYear(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to extract day of year component from.
Returns
ExtractTemporalUnit(SqlExpressionNode, SqlTemporalUnit)
Creates a new SqlExtractTemporalUnitFunctionExpressionNode instance.
[Pure]
public static SqlExtractTemporalUnitFunctionExpressionNode ExtractTemporalUnit(this SqlExpressionNode node, SqlTemporalUnit unit)
Parameters
node
SqlExpressionNodeExpression to extract the desired date or time component from.
unit
SqlTemporalUnitSqlTemporalUnit that specifies the date or time component to extract.
Returns
- SqlExtractTemporalUnitFunctionExpressionNode
New SqlExtractTemporalUnitFunctionExpressionNode instance.
ExtractTimeOfDay(SqlExpressionNode)
Creates a new SqlExtractTimeOfDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractTimeOfDayFunctionExpressionNode ExtractTimeOfDay(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to extract time of day part from.
Returns
FirstValue(SqlExpressionNode)
Creates a new SqlFirstValueWindowFunctionExpressionNode instance.
[Pure]
public static SqlFirstValueWindowFunctionExpressionNode FirstValue(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the first value for.
Returns
Floor(SqlExpressionNode)
Creates a new SqlFloorFunctionExpressionNode instance.
[Pure]
public static SqlFloorFunctionExpressionNode Floor(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the floor value from.
Returns
- SqlFloorFunctionExpressionNode
New SqlFloorFunctionExpressionNode instance.
FullOn(SqlRecordSetNode, SqlConditionNode)
Creates a new SqlDataSourceJoinOnNode instance with Full type.
[Pure]
public static SqlDataSourceJoinOnNode FullOn(this SqlRecordSetNode node, SqlConditionNode onExpression)
Parameters
node
SqlRecordSetNodeInner SqlRecordSetNode instance.
onExpression
SqlConditionNodeCondition of this join operation.
Returns
- SqlDataSourceJoinOnNode
New SqlDataSourceJoinOnNode instance.
GetAll(SqlRecordSetNode)
Creates a new SqlSelectRecordSetNode instance.
[Pure]
public static SqlSelectRecordSetNode GetAll(this SqlRecordSetNode node)
Parameters
node
SqlRecordSetNodeSingle record set to select all data fields from.
Returns
- SqlSelectRecordSetNode
New SqlSelectRecordSetNode instance.
GetRawField(SqlRecordSetNode, string, TypeNullability?)
Creates a new SqlRawDataFieldNode instance.
[Pure]
public static SqlRawDataFieldNode GetRawField(this SqlRecordSetNode node, string name, TypeNullability? type)
Parameters
node
SqlRecordSetNodeSqlRecordSetNode that this data field belongs to.
name
stringName of this data field.
type
TypeNullability?Optional runtime type of this data field. Equal to null by default.
Returns
- SqlRawDataFieldNode
New SqlRawDataFieldNode instance.
In(SqlExpressionNode, params SqlExpressionNode[])
Creates a new SqlInConditionNode instance or SqlFalseNode
when expressions
are empty.
[Pure]
public static SqlConditionNode In(this SqlExpressionNode node, params SqlExpressionNode[] expressions)
Parameters
node
SqlExpressionNodeValue to check.
expressions
SqlExpressionNode[]Collection of values that the value is compared against.
Returns
- SqlConditionNode
New SqlInConditionNode instance or SqlFalseNode instance.
In(SqlExpressionNode, IEnumerable<SqlExpressionNode>)
Creates a new SqlInConditionNode instance or SqlFalseNode
when expressions
are empty.
[Pure]
public static SqlConditionNode In(this SqlExpressionNode node, IEnumerable<SqlExpressionNode> expressions)
Parameters
node
SqlExpressionNodeValue to check.
expressions
IEnumerable<SqlExpressionNode>Collection of values that the value is compared against.
Returns
- SqlConditionNode
New SqlInConditionNode instance or SqlFalseNode instance.
InQuery(SqlExpressionNode, SqlQueryExpressionNode)
Creates a new SqlInQueryConditionNode instance.
[Pure]
public static SqlInQueryConditionNode InQuery(this SqlExpressionNode node, SqlQueryExpressionNode query)
Parameters
node
SqlExpressionNodeValue to check.
query
SqlQueryExpressionNodeSub-query that the value is compared against.
Returns
- SqlInQueryConditionNode
New SqlInQueryConditionNode instance.
IndexOf(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlIndexOfFunctionExpressionNode instance.
[Pure]
public static SqlIndexOfFunctionExpressionNode IndexOf(this SqlExpressionNode node, SqlExpressionNode value)
Parameters
node
SqlExpressionNodeExpression to find the first occurrence in.
value
SqlExpressionNodeValue to search for.
Returns
InnerOn(SqlRecordSetNode, SqlConditionNode)
Creates a new SqlDataSourceJoinOnNode instance with Inner type.
[Pure]
public static SqlDataSourceJoinOnNode InnerOn(this SqlRecordSetNode node, SqlConditionNode onExpression)
Parameters
node
SqlRecordSetNodeInner SqlRecordSetNode instance.
onExpression
SqlConditionNodeCondition of this join operation.
Returns
- SqlDataSourceJoinOnNode
New SqlDataSourceJoinOnNode instance.
IsBetween(SqlExpressionNode?, SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlBetweenConditionNode instance.
[Pure]
public static SqlBetweenConditionNode IsBetween(this SqlExpressionNode? node, SqlExpressionNode? min, SqlExpressionNode? max)
Parameters
node
SqlExpressionNodeValue to check.
min
SqlExpressionNodeMinimum acceptable value.
max
SqlExpressionNodeMaximum acceptable value.
Returns
- SqlBetweenConditionNode
New SqlBetweenConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
IsEqualTo(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlEqualToConditionNode instance.
[Pure]
public static SqlEqualToConditionNode IsEqualTo(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlEqualToConditionNode
New SqlEqualToConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
IsGreaterThan(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlGreaterThanConditionNode instance.
[Pure]
public static SqlGreaterThanConditionNode IsGreaterThan(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlGreaterThanConditionNode
New SqlGreaterThanConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
IsGreaterThanOrEqualTo(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlGreaterThanOrEqualToConditionNode instance.
[Pure]
public static SqlGreaterThanOrEqualToConditionNode IsGreaterThanOrEqualTo(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
Remarks
Null values will be replaced with SqlNullNode instances.
IsLessThan(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlLessThanConditionNode instance.
[Pure]
public static SqlLessThanConditionNode IsLessThan(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlLessThanConditionNode
New SqlLessThanConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
IsLessThanOrEqualTo(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlLessThanOrEqualToConditionNode instance.
[Pure]
public static SqlLessThanOrEqualToConditionNode IsLessThanOrEqualTo(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
Remarks
Null values will be replaced with SqlNullNode instances.
IsNotBetween(SqlExpressionNode?, SqlExpressionNode?, SqlExpressionNode?)
Creates a new negated SqlBetweenConditionNode instance.
[Pure]
public static SqlBetweenConditionNode IsNotBetween(this SqlExpressionNode? node, SqlExpressionNode? min, SqlExpressionNode? max)
Parameters
node
SqlExpressionNodeValue to check.
min
SqlExpressionNodeMinimum acceptable value.
max
SqlExpressionNodeMaximum acceptable value.
Returns
- SqlBetweenConditionNode
New negated SqlBetweenConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
IsNotEqualTo(SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlNotEqualToConditionNode instance.
[Pure]
public static SqlNotEqualToConditionNode IsNotEqualTo(this SqlExpressionNode? node, SqlExpressionNode? right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlNotEqualToConditionNode
New SqlNotEqualToConditionNode instance.
Remarks
Null values will be replaced with SqlNullNode instances.
Join(SqlDataSourceNode, params SqlDataSourceJoinOnNode[])
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlDataSourceNode node, params SqlDataSourceJoinOnNode[] joins)
Parameters
node
SqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
joins
SqlDataSourceJoinOnNode[]Sequential collection of all SqlDataSourceJoinOnNode instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlDataSourceNode, params SqlJoinDefinition[])
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlDataSourceNode node, params SqlJoinDefinition[] definitions)
Parameters
node
SqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
definitions
SqlJoinDefinition[]Sequential collection of all SqlJoinDefinition instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlDataSourceNode, IEnumerable<SqlDataSourceJoinOnNode>)
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlDataSourceNode node, IEnumerable<SqlDataSourceJoinOnNode> joins)
Parameters
node
SqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
joins
IEnumerable<SqlDataSourceJoinOnNode>Sequential collection of all SqlDataSourceJoinOnNode instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlDataSourceNode, IEnumerable<SqlJoinDefinition>)
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlDataSourceNode node, IEnumerable<SqlJoinDefinition> definitions)
Parameters
node
SqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
definitions
IEnumerable<SqlJoinDefinition>Sequential collection of all SqlJoinDefinition instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlRecordSetNode, params SqlDataSourceJoinOnNode[])
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlRecordSetNode node, params SqlDataSourceJoinOnNode[] joins)
Parameters
node
SqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
joins
SqlDataSourceJoinOnNode[]Sequential collection of all SqlDataSourceJoinOnNode instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlRecordSetNode, params SqlJoinDefinition[])
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlRecordSetNode node, params SqlJoinDefinition[] definitions)
Parameters
node
SqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
definitions
SqlJoinDefinition[]Sequential collection of all SqlJoinDefinition instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlRecordSetNode, IEnumerable<SqlDataSourceJoinOnNode>)
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlRecordSetNode node, IEnumerable<SqlDataSourceJoinOnNode> joins)
Parameters
node
SqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
joins
IEnumerable<SqlDataSourceJoinOnNode>Sequential collection of all SqlDataSourceJoinOnNode instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Join(SqlRecordSetNode, IEnumerable<SqlJoinDefinition>)
Creates a new SqlMultiDataSourceNode instance.
[Pure]
public static SqlMultiDataSourceNode Join(this SqlRecordSetNode node, IEnumerable<SqlJoinDefinition> definitions)
Parameters
node
SqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
definitions
IEnumerable<SqlJoinDefinition>Sequential collection of all SqlJoinDefinition instances that define this data source.
Returns
- SqlMultiDataSourceNode
New SqlMultiDataSourceNode instance.
Lag(SqlExpressionNode, SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlLagWindowFunctionExpressionNode instance.
[Pure]
public static SqlLagWindowFunctionExpressionNode Lag(this SqlExpressionNode node, SqlExpressionNode? offset = null, SqlExpressionNode? @default = null)
Parameters
node
SqlExpressionNodeExpression to calculate the lag for.
offset
SqlExpressionNodeOptional offset. Equal to SQL literal that represents 1 by default.
default
SqlExpressionNodeOptional default value. Equal to null by default.
Returns
LastIndexOf(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlLastIndexOfFunctionExpressionNode instance.
[Pure]
public static SqlLastIndexOfFunctionExpressionNode LastIndexOf(this SqlExpressionNode node, SqlExpressionNode value)
Parameters
node
SqlExpressionNodeExpression to find the last occurrence in.
value
SqlExpressionNodeValue to search for.
Returns
LastValue(SqlExpressionNode)
Creates a new SqlLastValueWindowFunctionExpressionNode instance.
[Pure]
public static SqlLastValueWindowFunctionExpressionNode LastValue(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the last value for.
Returns
Lead(SqlExpressionNode, SqlExpressionNode?, SqlExpressionNode?)
Creates a new SqlLeadWindowFunctionExpressionNode instance.
[Pure]
public static SqlLeadWindowFunctionExpressionNode Lead(this SqlExpressionNode node, SqlExpressionNode? offset = null, SqlExpressionNode? @default = null)
Parameters
node
SqlExpressionNodeExpression to calculate the lead for.
offset
SqlExpressionNodeOptional offset. Equal to SQL literal that represents 1 by default.
default
SqlExpressionNodeOptional default value. Equal to null by default.
Returns
LeftOn(SqlRecordSetNode, SqlConditionNode)
Creates a new SqlDataSourceJoinOnNode instance with Left type.
[Pure]
public static SqlDataSourceJoinOnNode LeftOn(this SqlRecordSetNode node, SqlConditionNode onExpression)
Parameters
node
SqlRecordSetNodeInner SqlRecordSetNode instance.
onExpression
SqlConditionNodeCondition of this join operation.
Returns
- SqlDataSourceJoinOnNode
New SqlDataSourceJoinOnNode instance.
Length(SqlExpressionNode)
Creates a new SqlLengthFunctionExpressionNode instance.
[Pure]
public static SqlLengthFunctionExpressionNode Length(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate length from.
Returns
Like(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlLikeConditionNode instance.
[Pure]
public static SqlLikeConditionNode Like(this SqlExpressionNode node, SqlExpressionNode pattern, SqlExpressionNode? escape = null)
Parameters
node
SqlExpressionNodeValue to check.
pattern
SqlExpressionNodeString pattern to check the value against.
escape
SqlExpressionNodeOptional escape character for the pattern. Equal to null by default.
Returns
- SqlLikeConditionNode
New SqlLikeConditionNode instance.
Max(SqlExpressionNode)
Creates a new SqlMaxAggregateFunctionExpressionNode instance.
[Pure]
public static SqlMaxAggregateFunctionExpressionNode Max(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the maximum value for.
Returns
Max(SqlExpressionNode, params SqlExpressionNode[])
Creates a new SqlMaxFunctionExpressionNode instance.
[Pure]
public static SqlMaxFunctionExpressionNode Max(this SqlExpressionNode node, params SqlExpressionNode[] other)
Parameters
node
SqlExpressionNodeFirst expression to calculate the maximum value from.
other
SqlExpressionNode[]Collection of following expressions to calculate the maximum value from.
Returns
- SqlMaxFunctionExpressionNode
New SqlMaxFunctionExpressionNode instance.
Min(SqlExpressionNode)
Creates a new SqlMinAggregateFunctionExpressionNode instance.
[Pure]
public static SqlMinAggregateFunctionExpressionNode Min(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the minimum value for.
Returns
Min(SqlExpressionNode, params SqlExpressionNode[])
Creates a new SqlMinFunctionExpressionNode instance.
[Pure]
public static SqlMinFunctionExpressionNode Min(this SqlExpressionNode node, params SqlExpressionNode[] other)
Parameters
node
SqlExpressionNodeFirst expression to calculate the minimum value from.
other
SqlExpressionNode[]Collection of following expressions to calculate the minimum value from.
Returns
- SqlMinFunctionExpressionNode
New SqlMinFunctionExpressionNode instance.
Modulo(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlModuloExpressionNode instance.
[Pure]
public static SqlModuloExpressionNode Modulo(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlModuloExpressionNode
New SqlModuloExpressionNode instance.
Multiply(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlMultiplyExpressionNode instance.
[Pure]
public static SqlMultiplyExpressionNode Multiply(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlMultiplyExpressionNode
New SqlMultiplyExpressionNode instance.
NTile(SqlExpressionNode)
Creates a new SqlNTileWindowFunctionExpressionNode instance.
[Pure]
public static SqlNTileWindowFunctionExpressionNode NTile(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeNumber of groups.
Returns
Negate(SqlExpressionNode)
Creates a new SqlNegateExpressionNode instance.
[Pure]
public static SqlNegateExpressionNode Negate(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeOperand.
Returns
- SqlNegateExpressionNode
New SqlNegateExpressionNode instance.
NotExists(SqlRecordSetNode)
Creates a new negated SqlExistsConditionNode instance.
[Pure]
public static SqlExistsConditionNode NotExists(this SqlRecordSetNode node)
Parameters
node
SqlRecordSetNodeRecord set of the sub-query to check.
Returns
- SqlExistsConditionNode
New negated SqlExistsConditionNode instance.
NotIn(SqlExpressionNode, params SqlExpressionNode[])
Creates a new negated SqlInConditionNode instance or SqlTrueNode
when expressions
are empty.
[Pure]
public static SqlConditionNode NotIn(this SqlExpressionNode node, params SqlExpressionNode[] expressions)
Parameters
node
SqlExpressionNodeValue to check.
expressions
SqlExpressionNode[]Collection of values that the value is compared against.
Returns
- SqlConditionNode
New negated SqlInConditionNode instance or SqlTrueNode instance.
NotIn(SqlExpressionNode, IEnumerable<SqlExpressionNode>)
Creates a new negated SqlInConditionNode instance or SqlTrueNode
when expressions
are empty.
[Pure]
public static SqlConditionNode NotIn(this SqlExpressionNode node, IEnumerable<SqlExpressionNode> expressions)
Parameters
node
SqlExpressionNodeValue to check.
expressions
IEnumerable<SqlExpressionNode>Collection of values that the value is compared against.
Returns
- SqlConditionNode
New negated SqlInConditionNode instance or SqlTrueNode instance.
NotInQuery(SqlExpressionNode, SqlQueryExpressionNode)
Creates a new negated SqlInQueryConditionNode instance.
[Pure]
public static SqlInQueryConditionNode NotInQuery(this SqlExpressionNode node, SqlQueryExpressionNode query)
Parameters
node
SqlExpressionNodeValue to check.
query
SqlQueryExpressionNodeSub-query that the value is compared against.
Returns
- SqlInQueryConditionNode
New negated SqlInQueryConditionNode instance.
NotLike(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode?)
Creates a new negated SqlLikeConditionNode instance.
[Pure]
public static SqlLikeConditionNode NotLike(this SqlExpressionNode node, SqlExpressionNode pattern, SqlExpressionNode? escape = null)
Parameters
node
SqlExpressionNodeValue to check.
pattern
SqlExpressionNodeString pattern to check the value against.
escape
SqlExpressionNodeOptional escape character for the pattern. Equal to null by default.
Returns
- SqlLikeConditionNode
New negated SqlLikeConditionNode instance.
NthValue(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlNthValueWindowFunctionExpressionNode instance.
[Pure]
public static SqlNthValueWindowFunctionExpressionNode NthValue(this SqlExpressionNode node, SqlExpressionNode n)
Parameters
node
SqlExpressionNodeExpression to calculate the n-th value for.
n
SqlExpressionNodeRow's position.
Returns
Or(SqlConditionNode, SqlConditionNode)
Creates a new SqlOrConditionNode instance.
[Pure]
public static SqlOrConditionNode Or(this SqlConditionNode node, SqlConditionNode right)
Parameters
node
SqlConditionNodeFirst operand.
right
SqlConditionNodeSecond operand.
Returns
- SqlOrConditionNode
New SqlOrConditionNode instance.
OrWhere<TAggregateFunctionNode>(TAggregateFunctionNode, SqlConditionNode)
Decorates the provided SQL aggregate function node with an SqlFilterTraitNode with IsConjunction set to false.
[Pure]
public static TAggregateFunctionNode OrWhere<TAggregateFunctionNode>(this TAggregateFunctionNode node, SqlConditionNode filter) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
filter
SqlConditionNodeUnderlying predicate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
OrderBy<TAggregateFunctionNode>(TAggregateFunctionNode, params SqlOrderByNode[])
Decorates the provided SQL aggregate function node with an SqlSortTraitNode.
[Pure]
public static TAggregateFunctionNode OrderBy<TAggregateFunctionNode>(this TAggregateFunctionNode node, params SqlOrderByNode[] ordering) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
ordering
SqlOrderByNode[]Collection of ordering definitions.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
OrderBy<TAggregateFunctionNode>(TAggregateFunctionNode, IEnumerable<SqlOrderByNode>)
Decorates the provided SQL aggregate function node with an SqlSortTraitNode.
[Pure]
public static TAggregateFunctionNode OrderBy<TAggregateFunctionNode>(this TAggregateFunctionNode node, IEnumerable<SqlOrderByNode> ordering) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
ordering
IEnumerable<SqlOrderByNode>Collection of ordering definitions.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
Over<TAggregateFunctionNode>(TAggregateFunctionNode, SqlWindowDefinitionNode)
Decorates the provided SQL aggregate function node with an SqlWindowTraitNode.
[Pure]
public static TAggregateFunctionNode Over<TAggregateFunctionNode>(this TAggregateFunctionNode node, SqlWindowDefinitionNode window) where TAggregateFunctionNode : SqlAggregateFunctionExpressionNode
Parameters
node
TAggregateFunctionNodeAggregate function node to decorate.
window
SqlWindowDefinitionNodeUnderlying window definition.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNode
SQL aggregate function node type.
Power(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlPowerFunctionExpressionNode instance.
[Pure]
public static SqlPowerFunctionExpressionNode Power(this SqlExpressionNode node, SqlExpressionNode power)
Parameters
node
SqlExpressionNodeExpression to raise to the desired power.
power
SqlExpressionNodeExpression that defines the desired power to raise to.
Returns
- SqlPowerFunctionExpressionNode
New SqlPowerFunctionExpressionNode instance.
Replace(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode)
Creates a new SqlReplaceFunctionExpressionNode instance.
[Pure]
public static SqlReplaceFunctionExpressionNode Replace(this SqlExpressionNode node, SqlExpressionNode oldValue, SqlExpressionNode newValue)
Parameters
node
SqlExpressionNodeExpression to replace occurrences in.
oldValue
SqlExpressionNodeValue to replace.
newValue
SqlExpressionNodeReplacement value.
Returns
Reverse(SqlExpressionNode)
Creates a new SqlReverseFunctionExpressionNode instance.
[Pure]
public static SqlReverseFunctionExpressionNode Reverse(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to reverse.
Returns
RightOn(SqlRecordSetNode, SqlConditionNode)
Creates a new SqlDataSourceJoinOnNode instance with Right type.
[Pure]
public static SqlDataSourceJoinOnNode RightOn(this SqlRecordSetNode node, SqlConditionNode onExpression)
Parameters
node
SqlRecordSetNodeInner SqlRecordSetNode instance.
onExpression
SqlConditionNodeCondition of this join operation.
Returns
- SqlDataSourceJoinOnNode
New SqlDataSourceJoinOnNode instance.
Round(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlRoundFunctionExpressionNode instance.
[Pure]
public static SqlRoundFunctionExpressionNode Round(this SqlExpressionNode node, SqlExpressionNode precision)
Parameters
node
SqlExpressionNodeExpression to calculate the rounded value from.
precision
SqlExpressionNodeDecimal rounding precision.
Returns
- SqlRoundFunctionExpressionNode
New SqlRoundFunctionExpressionNode instance.
Sign(SqlExpressionNode)
Creates a new SqlSignFunctionExpressionNode instance.
[Pure]
public static SqlSignFunctionExpressionNode Sign(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the sign from.
Returns
- SqlSignFunctionExpressionNode
New SqlSignFunctionExpressionNode instance.
SquareRoot(SqlExpressionNode)
Creates a new SqlSquareRootFunctionExpressionNode instance.
[Pure]
public static SqlSquareRootFunctionExpressionNode SquareRoot(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the square root from.
Returns
StringConcat(SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlStringConcatAggregateFunctionExpressionNode instance.
[Pure]
public static SqlStringConcatAggregateFunctionExpressionNode StringConcat(this SqlExpressionNode node, SqlExpressionNode? separator = null)
Parameters
node
SqlExpressionNodeExpression to calculate the concatenated string for.
separator
SqlExpressionNodeOptional separator of concatenated strings. Equal to null by default.
Returns
- SqlStringConcatAggregateFunctionExpressionNode
New SqlStringConcatAggregateFunctionExpressionNode instance.
Substring(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlSubstringFunctionExpressionNode instance.
[Pure]
public static SqlSubstringFunctionExpressionNode Substring(this SqlExpressionNode node, SqlExpressionNode startIndex, SqlExpressionNode? length = null)
Parameters
node
SqlExpressionNodeExpression to extract a substring from.
startIndex
SqlExpressionNodePosition of the first character of the substring.
length
SqlExpressionNodeOptional length of the substring. Equal to null by default.
Returns
Subtract(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlSubtractExpressionNode instance.
[Pure]
public static SqlSubtractExpressionNode Subtract(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
node
SqlExpressionNodeFirst operand.
right
SqlExpressionNodeSecond operand.
Returns
- SqlSubtractExpressionNode
New SqlSubtractExpressionNode instance.
Sum(SqlExpressionNode)
Creates a new SqlSumAggregateFunctionExpressionNode instance.
[Pure]
public static SqlSumAggregateFunctionExpressionNode Sum(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to calculate the sum value for.
Returns
TemporalAdd(SqlExpressionNode, SqlExpressionNode, SqlTemporalUnit)
Creates a new SqlTemporalAddFunctionExpressionNode instance.
[Pure]
public static SqlTemporalAddFunctionExpressionNode TemporalAdd(this SqlExpressionNode node, SqlExpressionNode value, SqlTemporalUnit unit)
Parameters
node
SqlExpressionNodeExpression to add value to.
value
SqlExpressionNodeValue to add.
unit
SqlTemporalUnitSqlTemporalUnit that specifies the unit of the added value.
Returns
TemporalDiff(SqlExpressionNode, SqlExpressionNode, SqlTemporalUnit)
Creates a new SqlTemporalDiffFunctionExpressionNode instance.
[Pure]
public static SqlTemporalDiffFunctionExpressionNode TemporalDiff(this SqlExpressionNode node, SqlExpressionNode end, SqlTemporalUnit unit)
Parameters
node
SqlExpressionNodeExpression that defines the start value.
end
SqlExpressionNodeExpression that defines the end value.
unit
SqlTemporalUnitSqlTemporalUnit that specifies the unit of the returned result.
Returns
Then(SqlConditionNode, SqlExpressionNode)
Creates a new SqlSwitchCaseNode instance.
[Pure]
public static SqlSwitchCaseNode Then(this SqlConditionNode node, SqlExpressionNode value)
Parameters
node
SqlConditionNodeUnderlying condition.
value
SqlExpressionNodeUnderlying expression.
Returns
- SqlSwitchCaseNode
New SqlSwitchCaseNode instance.
ToDataSource<TRecordSetNode>(TRecordSetNode)
Creates a new SqlSingleDataSourceNode<TRecordSetNode> instance.
[Pure]
public static SqlSingleDataSourceNode<TRecordSetNode> ToDataSource<TRecordSetNode>(this TRecordSetNode node) where TRecordSetNode : SqlRecordSetNode
Parameters
node
TRecordSetNodeSqlRecordSetNode instance from which this data source's definition begins.
Returns
- SqlSingleDataSourceNode<TRecordSetNode>
New SqlSingleDataSourceNode<TRecordSetNode> instance.
Type Parameters
TRecordSetNode
SQL record set node type.
ToDropIndex(SqlCreateIndexNode, bool)
Creates a new SqlDropIndexNode instance.
[Pure]
public static SqlDropIndexNode ToDropIndex(this SqlCreateIndexNode node, bool ifExists = false)
Parameters
node
SqlCreateIndexNodeSource index.
ifExists
boolSpecifies whether or not the removal attempt should only be made if this index exists in DB. Equal to false by default.
Returns
- SqlDropIndexNode
New SqlDropIndexNode instance.
ToDropTable(SqlCreateTableNode, bool)
Creates a new SqlDropTableNode instance.
[Pure]
public static SqlDropTableNode ToDropTable(this SqlCreateTableNode node, bool ifExists = false)
Parameters
node
SqlCreateTableNodeSource table.
ifExists
boolSpecifies whether or not the removal attempt should only be made if this table exists in DB. Equal to false by default.
Returns
- SqlDropTableNode
New SqlDropTableNode instance.
ToDropView(SqlCreateViewNode, bool)
Creates a new SqlDropViewNode instance.
[Pure]
public static SqlDropViewNode ToDropView(this SqlCreateViewNode node, bool ifExists = false)
Parameters
node
SqlCreateViewNodeSource view.
ifExists
boolSpecifies whether or not the removal attempt should only be made if this view exists in DB. Equal to false by default.
Returns
- SqlDropViewNode
New SqlDropViewNode instance.
ToExpression(SqlSelectNode)
Creates a new SqlSelectExpressionNode instance.
[Pure]
public static SqlSelectExpressionNode ToExpression(this SqlSelectNode node)
Parameters
node
SqlSelectNodeUnderlying selection.
Returns
- SqlSelectExpressionNode
New SqlSelectExpressionNode instance.
ToInsertInto(SqlValuesNode, SqlRecordSetNode, params SqlDataFieldNode[])
Creates a new SqlInsertIntoNode instance.
[Pure]
public static SqlInsertIntoNode ToInsertInto(this SqlValuesNode node, SqlRecordSetNode recordSet, params SqlDataFieldNode[] dataFields)
Parameters
node
SqlValuesNodeSqlValuesNode source of records to be inserted.
recordSet
SqlRecordSetNodeTable to insert into.
dataFields
SqlDataFieldNode[]Collection of record set data fields that this insertion refers to.
Returns
- SqlInsertIntoNode
New SqlInsertIntoNode instance.
ToInsertInto<TRecordSetNode>(SqlValuesNode, TRecordSetNode, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>)
Creates a new SqlInsertIntoNode instance.
[Pure]
public static SqlInsertIntoNode ToInsertInto<TRecordSetNode>(this SqlValuesNode node, TRecordSetNode recordSet, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>> dataFields) where TRecordSetNode : SqlRecordSetNode
Parameters
node
SqlValuesNodeSqlValuesNode source of records to be inserted.
recordSet
TRecordSetNodeTable to insert into.
dataFields
Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>Provider of collection of record set data fields that this insertion refers to.
Returns
- SqlInsertIntoNode
New SqlInsertIntoNode instance.
Type Parameters
TRecordSetNode
ToLower(SqlExpressionNode)
Creates a new SqlToLowerFunctionExpressionNode instance.
[Pure]
public static SqlToLowerFunctionExpressionNode ToLower(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to convert to lowercase.
Returns
ToQuery(SqlSelectFieldNode)
Creates a new SqlDataSourceQueryExpressionNode<TDataSourceNode> instance.
[Pure]
public static SqlDataSourceQueryExpressionNode<SqlDummyDataSourceNode> ToQuery(this SqlSelectFieldNode node)
Parameters
node
SqlSelectFieldNodeSingle data field selection to include in query's selection.
Returns
- SqlDataSourceQueryExpressionNode<SqlDummyDataSourceNode>
New SqlDataSourceQueryExpressionNode<TDataSourceNode> instance.
ToRecordSet(ISqlTableBuilder, string?)
Creates a new SqlTableBuilderNode instance or returns table's Node
when provided alias
is null.
[Pure]
public static SqlTableBuilderNode ToRecordSet(this ISqlTableBuilder table, string? alias = null)
Parameters
table
ISqlTableBuilderUnderlying ISqlTableBuilder instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlTableBuilderNode
New SqlTableBuilderNode instance or table's Node when provided
alias
is null.
ToRecordSet(ISqlViewBuilder, string?)
Creates a new SqlViewBuilderNode instance or returns view's Node
when provided alias
is null.
[Pure]
public static SqlViewBuilderNode ToRecordSet(this ISqlViewBuilder view, string? alias = null)
Parameters
view
ISqlViewBuilderUnderlying ISqlViewBuilder instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlViewBuilderNode
New SqlViewBuilderNode instance or view's Node when provided
alias
is null.
ToRecordSet(ISqlTable, string?)
Creates a new SqlTableNode instance or returns table's Node
when provided alias
is null.
[Pure]
public static SqlTableNode ToRecordSet(this ISqlTable table, string? alias = null)
Parameters
table
ISqlTableUnderlying ISqlTable instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlTableNode
New SqlTableNode instance or table's Node when provided
alias
is null.
ToRecordSet(ISqlView, string?)
Creates a new SqlViewNode instance or returns view's Node
when provided alias
is null.
[Pure]
public static SqlViewNode ToRecordSet(this ISqlView view, string? alias = null)
Parameters
view
ISqlViewUnderlying ISqlView instance.
alias
stringOptional alias of this record set. Equal to null by default.
Returns
- SqlViewNode
New SqlViewNode instance or view's Node when provided
alias
is null.
ToTruncate(SqlRecordSetNode)
Creates a new SqlTruncateNode instance.
[Pure]
public static SqlTruncateNode ToTruncate(this SqlRecordSetNode node)
Parameters
node
SqlRecordSetNodeTable to truncate.
Returns
- SqlTruncateNode
New SqlTruncateNode instance.
ToUpper(SqlExpressionNode)
Creates a new SqlToUpperFunctionExpressionNode instance.
[Pure]
public static SqlToUpperFunctionExpressionNode ToUpper(this SqlExpressionNode node)
Parameters
node
SqlExpressionNodeExpression to convert to uppercase.
Returns
ToUpsert(SqlValuesNode, SqlRecordSetNode, ReadOnlyArray<SqlDataFieldNode>, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>, ReadOnlyArray<SqlDataFieldNode>?)
Creates a new SqlUpsertNode instance.
[Pure]
public static SqlUpsertNode ToUpsert(this SqlValuesNode node, SqlRecordSetNode recordSet, ReadOnlyArray<SqlDataFieldNode> insertDataFields, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>> updateAssignments, ReadOnlyArray<SqlDataFieldNode>? conflictTarget = null)
Parameters
node
SqlValuesNodeSqlValuesNode source of records to be inserted or updated.
recordSet
SqlRecordSetNodeTable to upsert into.
insertDataFields
ReadOnlyArray<SqlDataFieldNode>Collection of record set data fields that the insertion part of this upsert refers to.
updateAssignments
Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>Provider of a collection of value assignments that the update part of this upsert refers to. The first parameter is the table to upsert into and the second parameter is the UpdateSource of the created upsert node.
conflictTarget
ReadOnlyArray<SqlDataFieldNode>?Optional collection of data fields from the table that define the insertion conflict target. Empty conflict target may cause the table's primary key to be used instead. Equal to null by default.
Returns
- SqlUpsertNode
New SqlUpsertNode instance.
ToUpsert<TRecordSetNode>(SqlValuesNode, TRecordSetNode, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>, Func<TRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>?)
Creates a new SqlUpsertNode instance.
[Pure]
public static SqlUpsertNode ToUpsert<TRecordSetNode>(this SqlValuesNode node, TRecordSetNode recordSet, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>> insertDataFields, Func<TRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>> updateAssignments, Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>? conflictTarget = null) where TRecordSetNode : SqlRecordSetNode
Parameters
node
SqlValuesNodeSqlValuesNode source of records to be inserted or updated.
recordSet
TRecordSetNodeTable to upsert into.
insertDataFields
Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>Provider of collection of record set data fields that the insertion part of this upsert refers to.
updateAssignments
Func<TRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>Provider of a collection of value assignments that the update part of this upsert refers to. The first parameter is the table to upsert into and the second parameter is the UpdateSource of the created upsert node.
conflictTarget
Func<TRecordSetNode, IEnumerable<SqlDataFieldNode>>Optional provider of collection of data fields from the table that define the insertion conflict target. Empty conflict target may cause the table's primary key to be used instead. Equal to null by default.
Returns
- SqlUpsertNode
New SqlUpsertNode instance.
Type Parameters
TRecordSetNode
ToValue(SqlConditionNode)
Creates a new SqlConditionValueNode instance.
[Pure]
public static SqlConditionValueNode ToValue(this SqlConditionNode node)
Parameters
node
SqlConditionNodeUnderlying condition.
Returns
- SqlConditionValueNode
New SqlConditionValueNode instance.
Trim(SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlTrimFunctionExpressionNode instance.
[Pure]
public static SqlTrimFunctionExpressionNode Trim(this SqlExpressionNode node, SqlExpressionNode? characters = null)
Parameters
node
SqlExpressionNodeExpression to trim at both ends.
characters
SqlExpressionNodeOptional characters to trim away. Equal to null by default.
Returns
- SqlTrimFunctionExpressionNode
New SqlTrimFunctionExpressionNode instance.
TrimEnd(SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlTrimEndFunctionExpressionNode instance.
[Pure]
public static SqlTrimEndFunctionExpressionNode TrimEnd(this SqlExpressionNode node, SqlExpressionNode? characters = null)
Parameters
node
SqlExpressionNodeExpression to trim at the end.
characters
SqlExpressionNodeOptional characters to trim away. Equal to null by default.
Returns
TrimStart(SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlTrimStartFunctionExpressionNode instance.
[Pure]
public static SqlTrimStartFunctionExpressionNode TrimStart(this SqlExpressionNode node, SqlExpressionNode? characters = null)
Parameters
node
SqlExpressionNodeExpression to trim at the start.
characters
SqlExpressionNodeOptional characters to trim away. Equal to null by default.
Returns
Truncate(SqlExpressionNode, SqlExpressionNode?)
Creates a new SqlTruncateFunctionExpressionNode instance.
[Pure]
public static SqlTruncateFunctionExpressionNode Truncate(this SqlExpressionNode node, SqlExpressionNode? precision = null)
Parameters
node
SqlExpressionNodeExpression to calculate the truncated value from.
precision
SqlExpressionNodeOptional decimal precision of the truncation. Equal to null by default.