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
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlConditionNodeFirst operand.
rightSqlConditionNodeSecond 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
nodeSqlUpdateNodeSource update node.
assignmentsSqlValueAssignmentNode[]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
nodeSqlUpdateNodeSource update node.
assignmentsFunc<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
nodeTAggregateFunctionNodeAggregate function node to decorate.
filterSqlConditionNodeUnderlying predicate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL aggregate function node type.
As(SqlConditionNode, string)
Creates a new SqlSelectFieldNode instance.
[Pure]
public static SqlSelectFieldNode As(this SqlConditionNode node, string alias)
Parameters
nodeSqlConditionNodeSelected condition that will be converted to an expression.
aliasstringAlias 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
nodeSqlExpressionNodeSelected expression.
aliasstringAlias 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
nodeSqlDataFieldNodeSelected 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
nodeSqlNamedFunctionExpressionNodeUnderlying SqlNamedFunctionExpressionNode instance.
aliasstringAlias 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
nodeSqlCreateTableNodeUnderlying SqlCreateTableNode instance.
aliasstringOptional alias of this record set. Equal to null by default.
Returns
- SqlNewTableNode
New SqlNewTableNode instance or created table's RecordSet when provided
aliasis null.
AsSet(SqlCreateViewNode, string?)
Creates a new SqlNewViewNode instance.
[Pure]
public static SqlNewViewNode AsSet(this SqlCreateViewNode node, string? alias = null)
Parameters
nodeSqlCreateViewNodeUnderlying SqlCreateViewNode instance.
aliasstringOptional 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
nodeSqlExpressionNodeUnderlying 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
nodeSqlSelectNodeUnderlying 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
nodeSqlDataFieldNodeData field to assign value to.
valueSqlExpressionNodeValue to assign.
Returns
- SqlValueAssignmentNode
New SqlValueAssignmentNode instance.
Average(SqlExpressionNode)
Creates a new SqlAverageAggregateFunctionExpressionNode instance.
[Pure]
public static SqlAverageAggregateFunctionExpressionNode Average(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
BitwiseNot(SqlExpressionNode)
Creates a new SqlBitwiseNotExpressionNode instance.
[Pure]
public static SqlBitwiseNotExpressionNode BitwiseNot(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeOperand.
Returns
- SqlBitwiseNotExpressionNode
New SqlBitwiseNotExpressionNode instance.
BitwiseOr(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseOrExpressionNode instance.
[Pure]
public static SqlBitwiseOrExpressionNode BitwiseOr(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
BitwiseXor(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlBitwiseXorExpressionNode instance.
[Pure]
public static SqlBitwiseXorExpressionNode BitwiseXor(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
- SqlBitwiseXorExpressionNode
New SqlBitwiseXorExpressionNode instance.
ByteLength(SqlExpressionNode)
Creates a new SqlByteLengthFunctionExpressionNode instance.
[Pure]
public static SqlByteLengthFunctionExpressionNode ByteLength(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeUnderlying value to cast to a different type.
typeDefinitionISqlColumnTypeDefinitionISqlColumnTypeDefinition 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
nodeSqlExpressionNodeUnderlying value to cast to a different type.
typeTypeTarget 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
nodeSqlExpressionNodeUnderlying value to cast to a different type.
Returns
- SqlTypeCastExpressionNode
New SqlTypeCastExpressionNode instance.
Type Parameters
TTarget runtime type.
Ceiling(SqlExpressionNode)
Creates a new SqlCeilingFunctionExpressionNode instance.
[Pure]
public static SqlCeilingFunctionExpressionNode Ceiling(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeFirst argument of the function.
otherSqlExpressionNode[]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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
- SqlConcatExpressionNode
New SqlAddExpressionNode instance.
Count(SqlExpressionNode)
Creates a new SqlCountAggregateFunctionExpressionNode instance.
[Pure]
public static SqlCountAggregateFunctionExpressionNode Count(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlRecordSetNodeInner 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
nodeSqlExpressionNodeUnderlying 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
nodeSqlSelectNodeUnderlying 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
nodeTAggregateFunctionNodeAggregate function node to decorate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL aggregate function node type.
Divide(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlDivideExpressionNode instance.
[Pure]
public static SqlDivideExpressionNode Divide(this SqlExpressionNode node, SqlExpressionNode right)
Parameters
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlLikeConditionNodeValue to check.
escapeSqlExpressionNodeEscape 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
nodeSqlRecordSetNodeRecord 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
nodeSqlExpressionNodeExpression to extract date part from.
Returns
ExtractDayOfMonth(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfMonth(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression to extract day of month component from.
Returns
ExtractDayOfWeek(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfWeek(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression to extract day of week component from.
Returns
ExtractDayOfYear(SqlExpressionNode)
Creates a new SqlExtractDayFunctionExpressionNode instance.
[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfYear(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression to extract the desired date or time component from.
unitSqlTemporalUnitSqlTemporalUnit 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
nodeSqlExpressionNodeExpression to extract time of day part from.
Returns
FirstValue(SqlExpressionNode)
Creates a new SqlFirstValueWindowFunctionExpressionNode instance.
[Pure]
public static SqlFirstValueWindowFunctionExpressionNode FirstValue(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression to calculate the first value for.
Returns
Floor(SqlExpressionNode)
Creates a new SqlFloorFunctionExpressionNode instance.
[Pure]
public static SqlFloorFunctionExpressionNode Floor(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlRecordSetNodeInner SqlRecordSetNode instance.
onExpressionSqlConditionNodeCondition 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
nodeSqlRecordSetNodeSingle 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
nodeSqlRecordSetNodeSqlRecordSetNode that this data field belongs to.
namestringName of this data field.
typeTypeNullability?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
nodeSqlExpressionNodeValue to check.
expressionsSqlExpressionNode[]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
nodeSqlExpressionNodeValue to check.
expressionsIEnumerable<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
nodeSqlExpressionNodeValue to check.
querySqlQueryExpressionNodeSub-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
nodeSqlExpressionNodeExpression to find the first occurrence in.
valueSqlExpressionNodeValue 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
nodeSqlRecordSetNodeInner SqlRecordSetNode instance.
onExpressionSqlConditionNodeCondition 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
nodeSqlExpressionNodeValue to check.
minSqlExpressionNodeMinimum acceptable value.
maxSqlExpressionNodeMaximum 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeValue to check.
minSqlExpressionNodeMinimum acceptable value.
maxSqlExpressionNodeMaximum 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
joinsSqlDataSourceJoinOnNode[]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
nodeSqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
definitionsSqlJoinDefinition[]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
nodeSqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
joinsIEnumerable<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
nodeSqlDataSourceNodeSqlDataSourceNode instance from which this data source's definition begins.
definitionsIEnumerable<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
nodeSqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
joinsSqlDataSourceJoinOnNode[]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
nodeSqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
definitionsSqlJoinDefinition[]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
nodeSqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
joinsIEnumerable<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
nodeSqlRecordSetNodeFirst SqlRecordSetNode instance from which this data source's definition begins.
definitionsIEnumerable<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
nodeSqlExpressionNodeExpression to calculate the lag for.
offsetSqlExpressionNodeOptional offset. Equal to SQL literal that represents 1 by default.
defaultSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to find the last occurrence in.
valueSqlExpressionNodeValue to search for.
Returns
LastValue(SqlExpressionNode)
Creates a new SqlLastValueWindowFunctionExpressionNode instance.
[Pure]
public static SqlLastValueWindowFunctionExpressionNode LastValue(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression to calculate the lead for.
offsetSqlExpressionNodeOptional offset. Equal to SQL literal that represents 1 by default.
defaultSqlExpressionNodeOptional 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
nodeSqlRecordSetNodeInner SqlRecordSetNode instance.
onExpressionSqlConditionNodeCondition 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
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeValue to check.
patternSqlExpressionNodeString pattern to check the value against.
escapeSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeFirst expression to calculate the maximum value from.
otherSqlExpressionNode[]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
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeFirst expression to calculate the minimum value from.
otherSqlExpressionNode[]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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
- SqlMultiplyExpressionNode
New SqlMultiplyExpressionNode instance.
NTile(SqlExpressionNode)
Creates a new SqlNTileWindowFunctionExpressionNode instance.
[Pure]
public static SqlNTileWindowFunctionExpressionNode NTile(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeNumber of groups.
Returns
Negate(SqlExpressionNode)
Creates a new SqlNegateExpressionNode instance.
[Pure]
public static SqlNegateExpressionNode Negate(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeOperand.
Returns
- SqlNegateExpressionNode
New SqlNegateExpressionNode instance.
NotExists(SqlRecordSetNode)
Creates a new negated SqlExistsConditionNode instance.
[Pure]
public static SqlExistsConditionNode NotExists(this SqlRecordSetNode node)
Parameters
nodeSqlRecordSetNodeRecord 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
nodeSqlExpressionNodeValue to check.
expressionsSqlExpressionNode[]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
nodeSqlExpressionNodeValue to check.
expressionsIEnumerable<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
nodeSqlExpressionNodeValue to check.
querySqlQueryExpressionNodeSub-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
nodeSqlExpressionNodeValue to check.
patternSqlExpressionNodeString pattern to check the value against.
escapeSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to calculate the n-th value for.
nSqlExpressionNodeRow's position.
Returns
Or(SqlConditionNode, SqlConditionNode)
Creates a new SqlOrConditionNode instance.
[Pure]
public static SqlOrConditionNode Or(this SqlConditionNode node, SqlConditionNode right)
Parameters
nodeSqlConditionNodeFirst operand.
rightSqlConditionNodeSecond 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
nodeTAggregateFunctionNodeAggregate function node to decorate.
filterSqlConditionNodeUnderlying predicate.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL 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
nodeTAggregateFunctionNodeAggregate function node to decorate.
orderingSqlOrderByNode[]Collection of ordering definitions.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL 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
nodeTAggregateFunctionNodeAggregate function node to decorate.
orderingIEnumerable<SqlOrderByNode>Collection of ordering definitions.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL 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
nodeTAggregateFunctionNodeAggregate function node to decorate.
windowSqlWindowDefinitionNodeUnderlying window definition.
Returns
- TAggregateFunctionNode
Decorated SQL aggregate function node.
Type Parameters
TAggregateFunctionNodeSQL aggregate function node type.
Power(SqlExpressionNode, SqlExpressionNode)
Creates a new SqlPowerFunctionExpressionNode instance.
[Pure]
public static SqlPowerFunctionExpressionNode Power(this SqlExpressionNode node, SqlExpressionNode power)
Parameters
nodeSqlExpressionNodeExpression to raise to the desired power.
powerSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression to replace occurrences in.
oldValueSqlExpressionNodeValue to replace.
newValueSqlExpressionNodeReplacement value.
Returns
Reverse(SqlExpressionNode)
Creates a new SqlReverseFunctionExpressionNode instance.
[Pure]
public static SqlReverseFunctionExpressionNode Reverse(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlRecordSetNodeInner SqlRecordSetNode instance.
onExpressionSqlConditionNodeCondition 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
nodeSqlExpressionNodeExpression to calculate the rounded value from.
precisionSqlExpressionNodeDecimal rounding precision.
Returns
- SqlRoundFunctionExpressionNode
New SqlRoundFunctionExpressionNode instance.
Sign(SqlExpressionNode)
Creates a new SqlSignFunctionExpressionNode instance.
[Pure]
public static SqlSignFunctionExpressionNode Sign(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression to calculate the concatenated string for.
separatorSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to extract a substring from.
startIndexSqlExpressionNodePosition of the first character of the substring.
lengthSqlExpressionNodeOptional 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
nodeSqlExpressionNodeFirst operand.
rightSqlExpressionNodeSecond operand.
Returns
- SqlSubtractExpressionNode
New SqlSubtractExpressionNode instance.
Sum(SqlExpressionNode)
Creates a new SqlSumAggregateFunctionExpressionNode instance.
[Pure]
public static SqlSumAggregateFunctionExpressionNode Sum(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlExpressionNodeExpression to add value to.
valueSqlExpressionNodeValue to add.
unitSqlTemporalUnitSqlTemporalUnit 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
nodeSqlExpressionNodeExpression that defines the start value.
endSqlExpressionNodeExpression that defines the end value.
unitSqlTemporalUnitSqlTemporalUnit 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
nodeSqlConditionNodeUnderlying condition.
valueSqlExpressionNodeUnderlying 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
nodeTRecordSetNodeSqlRecordSetNode instance from which this data source's definition begins.
Returns
- SqlSingleDataSourceNode<TRecordSetNode>
New SqlSingleDataSourceNode<TRecordSetNode> instance.
Type Parameters
TRecordSetNodeSQL record set node type.
ToDropIndex(SqlCreateIndexNode, bool)
Creates a new SqlDropIndexNode instance.
[Pure]
public static SqlDropIndexNode ToDropIndex(this SqlCreateIndexNode node, bool ifExists = false)
Parameters
nodeSqlCreateIndexNodeSource index.
ifExistsboolSpecifies 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
nodeSqlCreateTableNodeSource table.
ifExistsboolSpecifies 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
nodeSqlCreateViewNodeSource view.
ifExistsboolSpecifies 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
nodeSqlSelectNodeUnderlying 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
nodeSqlValuesNodeSqlValuesNode source of records to be inserted.
recordSetSqlRecordSetNodeTable to insert into.
dataFieldsSqlDataFieldNode[]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
nodeSqlValuesNodeSqlValuesNode source of records to be inserted.
recordSetTRecordSetNodeTable to insert into.
dataFieldsFunc<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
nodeSqlExpressionNodeExpression to convert to lowercase.
Returns
ToQuery(SqlSelectFieldNode)
Creates a new SqlDataSourceQueryExpressionNode<TDataSourceNode> instance.
[Pure]
public static SqlDataSourceQueryExpressionNode<SqlDummyDataSourceNode> ToQuery(this SqlSelectFieldNode node)
Parameters
nodeSqlSelectFieldNodeSingle 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
tableISqlTableBuilderUnderlying ISqlTableBuilder instance.
aliasstringOptional alias of this record set. Equal to null by default.
Returns
- SqlTableBuilderNode
New SqlTableBuilderNode instance or table's Node when provided
aliasis 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
viewISqlViewBuilderUnderlying ISqlViewBuilder instance.
aliasstringOptional alias of this record set. Equal to null by default.
Returns
- SqlViewBuilderNode
New SqlViewBuilderNode instance or view's Node when provided
aliasis 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
tableISqlTableUnderlying ISqlTable instance.
aliasstringOptional alias of this record set. Equal to null by default.
Returns
- SqlTableNode
New SqlTableNode instance or table's Node when provided
aliasis 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
viewISqlViewUnderlying ISqlView instance.
aliasstringOptional alias of this record set. Equal to null by default.
Returns
- SqlViewNode
New SqlViewNode instance or view's Node when provided
aliasis null.
ToTruncate(SqlRecordSetNode)
Creates a new SqlTruncateNode instance.
[Pure]
public static SqlTruncateNode ToTruncate(this SqlRecordSetNode node)
Parameters
nodeSqlRecordSetNodeTable to truncate.
Returns
- SqlTruncateNode
New SqlTruncateNode instance.
ToUpper(SqlExpressionNode)
Creates a new SqlToUpperFunctionExpressionNode instance.
[Pure]
public static SqlToUpperFunctionExpressionNode ToUpper(this SqlExpressionNode node)
Parameters
nodeSqlExpressionNodeExpression 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
nodeSqlValuesNodeSqlValuesNode source of records to be inserted or updated.
recordSetSqlRecordSetNodeTable to upsert into.
insertDataFieldsReadOnlyArray<SqlDataFieldNode>Collection of record set data fields that the insertion part of this upsert refers to.
updateAssignmentsFunc<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.
conflictTargetReadOnlyArray<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
nodeSqlValuesNodeSqlValuesNode source of records to be inserted or updated.
recordSetTRecordSetNodeTable to upsert into.
insertDataFieldsFunc<TRecordSetNode, IEnumerable<SqlDataFieldNode>>Provider of collection of record set data fields that the insertion part of this upsert refers to.
updateAssignmentsFunc<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.
conflictTargetFunc<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
nodeSqlConditionNodeUnderlying 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
nodeSqlExpressionNodeExpression to trim at both ends.
charactersSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to trim at the end.
charactersSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to trim at the start.
charactersSqlExpressionNodeOptional 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
nodeSqlExpressionNodeExpression to calculate the truncated value from.
precisionSqlExpressionNodeOptional decimal precision of the truncation. Equal to null by default.