Table of Contents

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 SqlExpressionNode

Expression 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlConditionNode

First operand.

right SqlConditionNode

Second 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 SqlUpdateNode

Source 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 SqlUpdateNode

Source 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 TAggregateFunctionNode

Aggregate function node to decorate.

filter SqlConditionNode

Underlying 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 SqlConditionNode

Selected condition that will be converted to an expression.

alias string

Alias 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 SqlExpressionNode

Selected expression.

alias string

Alias 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 SqlDataFieldNode

Selected 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 SqlNamedFunctionExpressionNode

Underlying SqlNamedFunctionExpressionNode instance.

alias string

Alias 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 SqlCreateTableNode

Underlying SqlCreateTableNode instance.

alias string

Optional 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 SqlCreateViewNode

Underlying SqlCreateViewNode instance.

alias string

Optional 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 SqlExpressionNode

Underlying 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 SqlSelectNode

Underlying 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 SqlDataFieldNode

Data field to assign value to.

value SqlExpressionNode

Value to assign.

Returns

SqlValueAssignmentNode

New SqlValueAssignmentNode instance.

Average(SqlExpressionNode)

[Pure]
public static SqlAverageAggregateFunctionExpressionNode Average(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate the average value for.

Returns

SqlAverageAggregateFunctionExpressionNode

New SqlAverageAggregateFunctionExpressionNode instance.

BitwiseAnd(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlBitwiseAndExpressionNode instance.

[Pure]
public static SqlBitwiseAndExpressionNode BitwiseAnd(this SqlExpressionNode node, SqlExpressionNode right)

Parameters

node SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlBitwiseLeftShiftExpressionNode

New SqlBitwiseLeftShiftExpressionNode instance.

BitwiseNot(SqlExpressionNode)

Creates a new SqlBitwiseNotExpressionNode instance.

[Pure]
public static SqlBitwiseNotExpressionNode BitwiseNot(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Operand.

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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlBitwiseRightShiftExpressionNode

New SqlBitwiseRightShiftExpressionNode instance.

BitwiseXor(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlBitwiseXorExpressionNode instance.

[Pure]
public static SqlBitwiseXorExpressionNode BitwiseXor(this SqlExpressionNode node, SqlExpressionNode right)

Parameters

node SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlBitwiseXorExpressionNode

New SqlBitwiseXorExpressionNode instance.

ByteLength(SqlExpressionNode)

Creates a new SqlByteLengthFunctionExpressionNode instance.

[Pure]
public static SqlByteLengthFunctionExpressionNode ByteLength(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate byte length from.

Returns

SqlByteLengthFunctionExpressionNode

New SqlByteLengthFunctionExpressionNode instance.

CastTo(SqlExpressionNode, ISqlColumnTypeDefinition)

Creates a new SqlTypeCastExpressionNode instance.

[Pure]
public static SqlTypeCastExpressionNode CastTo(this SqlExpressionNode node, ISqlColumnTypeDefinition typeDefinition)

Parameters

node SqlExpressionNode

Underlying value to cast to a different type.

typeDefinition ISqlColumnTypeDefinition

ISqlColumnTypeDefinition 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 SqlExpressionNode

Underlying value to cast to a different type.

type Type

Target 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 SqlExpressionNode

Underlying 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 SqlExpressionNode

Expression to calculate the ceiling value from.

Returns

SqlCeilingFunctionExpressionNode

New SqlCeilingFunctionExpressionNode instance.

Coalesce(SqlExpressionNode, params SqlExpressionNode[])

Creates a new SqlCoalesceFunctionExpressionNode instance.

[Pure]
public static SqlCoalesceFunctionExpressionNode Coalesce(this SqlExpressionNode node, params SqlExpressionNode[] other)

Parameters

node SqlExpressionNode

First argument of the function.

other SqlExpressionNode[]

Collection of following function's arguments.

Returns

SqlCoalesceFunctionExpressionNode

New SqlCoalesceFunctionExpressionNode instance.

Concat(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlAddExpressionNode instance.

[Pure]
public static SqlConcatExpressionNode Concat(this SqlExpressionNode node, SqlExpressionNode right)

Parameters

node SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlConcatExpressionNode

New SqlAddExpressionNode instance.

Count(SqlExpressionNode)

[Pure]
public static SqlCountAggregateFunctionExpressionNode Count(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate the number of records for.

Returns

SqlCountAggregateFunctionExpressionNode

New SqlCountAggregateFunctionExpressionNode instance.

Cross(SqlRecordSetNode)

Creates a new SqlDataSourceJoinOnNode instance with Cross type.

[Pure]
public static SqlDataSourceJoinOnNode Cross(this SqlRecordSetNode node)

Parameters

node SqlRecordSetNode

Inner 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 SqlExpressionNode

Underlying 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 SqlSelectNode

Underlying 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 TAggregateFunctionNode

Aggregate 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlLikeConditionNode

Value to check.

escape SqlExpressionNode

Escape 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 SqlRecordSetNode

Record 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 SqlExpressionNode

Expression to extract date part from.

Returns

SqlExtractDateFunctionExpressionNode

New SqlExtractDateFunctionExpressionNode instance.

ExtractDayOfMonth(SqlExpressionNode)

Creates a new SqlExtractDayFunctionExpressionNode instance.

[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfMonth(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to extract day of month component from.

Returns

SqlExtractDayFunctionExpressionNode

New SqlExtractDayFunctionExpressionNode instance.

ExtractDayOfWeek(SqlExpressionNode)

Creates a new SqlExtractDayFunctionExpressionNode instance.

[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfWeek(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to extract day of week component from.

Returns

SqlExtractDayFunctionExpressionNode

New SqlExtractDayFunctionExpressionNode instance.

ExtractDayOfYear(SqlExpressionNode)

Creates a new SqlExtractDayFunctionExpressionNode instance.

[Pure]
public static SqlExtractDayFunctionExpressionNode ExtractDayOfYear(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to extract day of year component from.

Returns

SqlExtractDayFunctionExpressionNode

New SqlExtractDayFunctionExpressionNode instance.

ExtractTemporalUnit(SqlExpressionNode, SqlTemporalUnit)

[Pure]
public static SqlExtractTemporalUnitFunctionExpressionNode ExtractTemporalUnit(this SqlExpressionNode node, SqlTemporalUnit unit)

Parameters

node SqlExpressionNode

Expression to extract the desired date or time component from.

unit SqlTemporalUnit

SqlTemporalUnit that specifies the date or time component to extract.

Returns

SqlExtractTemporalUnitFunctionExpressionNode

New SqlExtractTemporalUnitFunctionExpressionNode instance.

ExtractTimeOfDay(SqlExpressionNode)

[Pure]
public static SqlExtractTimeOfDayFunctionExpressionNode ExtractTimeOfDay(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to extract time of day part from.

Returns

SqlExtractTimeOfDayFunctionExpressionNode

New SqlExtractTimeOfDayFunctionExpressionNode instance.

FirstValue(SqlExpressionNode)

[Pure]
public static SqlFirstValueWindowFunctionExpressionNode FirstValue(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate the first value for.

Returns

SqlFirstValueWindowFunctionExpressionNode

New SqlFirstValueWindowFunctionExpressionNode instance.

Floor(SqlExpressionNode)

Creates a new SqlFloorFunctionExpressionNode instance.

[Pure]
public static SqlFloorFunctionExpressionNode Floor(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression 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 SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition 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 SqlRecordSetNode

Single 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 SqlRecordSetNode

SqlRecordSetNode that this data field belongs to.

name string

Name 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 SqlExpressionNode

Value 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 SqlExpressionNode

Value 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 SqlExpressionNode

Value to check.

query SqlQueryExpressionNode

Sub-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 SqlExpressionNode

Expression to find the first occurrence in.

value SqlExpressionNode

Value to search for.

Returns

SqlIndexOfFunctionExpressionNode

New SqlIndexOfFunctionExpressionNode instance.

InnerOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Inner type.

[Pure]
public static SqlDataSourceJoinOnNode InnerOn(this SqlRecordSetNode node, SqlConditionNode onExpression)

Parameters

node SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition 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 SqlExpressionNode

Value to check.

min SqlExpressionNode

Minimum acceptable value.

max SqlExpressionNode

Maximum 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlGreaterThanOrEqualToConditionNode

New SqlGreaterThanOrEqualToConditionNode instance.

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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlLessThanOrEqualToConditionNode

New SqlLessThanOrEqualToConditionNode instance.

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 SqlExpressionNode

Value to check.

min SqlExpressionNode

Minimum acceptable value.

max SqlExpressionNode

Maximum 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlDataSourceNode

SqlDataSourceNode 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 SqlDataSourceNode

SqlDataSourceNode 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 SqlDataSourceNode

SqlDataSourceNode 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 SqlDataSourceNode

SqlDataSourceNode 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 SqlRecordSetNode

First 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 SqlRecordSetNode

First 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 SqlRecordSetNode

First 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 SqlRecordSetNode

First 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 SqlExpressionNode

Expression to calculate the lag for.

offset SqlExpressionNode

Optional offset. Equal to SQL literal that represents 1 by default.

default SqlExpressionNode

Optional default value. Equal to null by default.

Returns

SqlLagWindowFunctionExpressionNode

New SqlLagWindowFunctionExpressionNode instance.

LastIndexOf(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlLastIndexOfFunctionExpressionNode instance.

[Pure]
public static SqlLastIndexOfFunctionExpressionNode LastIndexOf(this SqlExpressionNode node, SqlExpressionNode value)

Parameters

node SqlExpressionNode

Expression to find the last occurrence in.

value SqlExpressionNode

Value to search for.

Returns

SqlLastIndexOfFunctionExpressionNode

New SqlLastIndexOfFunctionExpressionNode instance.

LastValue(SqlExpressionNode)

[Pure]
public static SqlLastValueWindowFunctionExpressionNode LastValue(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate the last value for.

Returns

SqlLastValueWindowFunctionExpressionNode

New SqlLastValueWindowFunctionExpressionNode instance.

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 SqlExpressionNode

Expression to calculate the lead for.

offset SqlExpressionNode

Optional offset. Equal to SQL literal that represents 1 by default.

default SqlExpressionNode

Optional default value. Equal to null by default.

Returns

SqlLeadWindowFunctionExpressionNode

New SqlLeadWindowFunctionExpressionNode instance.

LeftOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Left type.

[Pure]
public static SqlDataSourceJoinOnNode LeftOn(this SqlRecordSetNode node, SqlConditionNode onExpression)

Parameters

node SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition 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 SqlExpressionNode

Expression to calculate length from.

Returns

SqlLengthFunctionExpressionNode

New SqlLengthFunctionExpressionNode instance.

Like(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode?)

Creates a new SqlLikeConditionNode instance.

[Pure]
public static SqlLikeConditionNode Like(this SqlExpressionNode node, SqlExpressionNode pattern, SqlExpressionNode? escape = null)

Parameters

node SqlExpressionNode

Value to check.

pattern SqlExpressionNode

String pattern to check the value against.

escape SqlExpressionNode

Optional 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 SqlExpressionNode

Expression to calculate the maximum value for.

Returns

SqlMaxAggregateFunctionExpressionNode

New SqlMaxAggregateFunctionExpressionNode instance.

Max(SqlExpressionNode, params SqlExpressionNode[])

Creates a new SqlMaxFunctionExpressionNode instance.

[Pure]
public static SqlMaxFunctionExpressionNode Max(this SqlExpressionNode node, params SqlExpressionNode[] other)

Parameters

node SqlExpressionNode

First 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 SqlExpressionNode

Expression to calculate the minimum value for.

Returns

SqlMinAggregateFunctionExpressionNode

New SqlMinAggregateFunctionExpressionNode instance.

Min(SqlExpressionNode, params SqlExpressionNode[])

Creates a new SqlMinFunctionExpressionNode instance.

[Pure]
public static SqlMinFunctionExpressionNode Min(this SqlExpressionNode node, params SqlExpressionNode[] other)

Parameters

node SqlExpressionNode

First 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second 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 SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlMultiplyExpressionNode

New SqlMultiplyExpressionNode instance.

NTile(SqlExpressionNode)

Creates a new SqlNTileWindowFunctionExpressionNode instance.

[Pure]
public static SqlNTileWindowFunctionExpressionNode NTile(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Number of groups.

Returns

SqlNTileWindowFunctionExpressionNode

New SqlNTileWindowFunctionExpressionNode instance.

Negate(SqlExpressionNode)

Creates a new SqlNegateExpressionNode instance.

[Pure]
public static SqlNegateExpressionNode Negate(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Operand.

Returns

SqlNegateExpressionNode

New SqlNegateExpressionNode instance.

NotExists(SqlRecordSetNode)

Creates a new negated SqlExistsConditionNode instance.

[Pure]
public static SqlExistsConditionNode NotExists(this SqlRecordSetNode node)

Parameters

node SqlRecordSetNode

Record 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 SqlExpressionNode

Value 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 SqlExpressionNode

Value 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 SqlExpressionNode

Value to check.

query SqlQueryExpressionNode

Sub-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 SqlExpressionNode

Value to check.

pattern SqlExpressionNode

String pattern to check the value against.

escape SqlExpressionNode

Optional escape character for the pattern. Equal to null by default.

Returns

SqlLikeConditionNode

New negated SqlLikeConditionNode instance.

NthValue(SqlExpressionNode, SqlExpressionNode)

[Pure]
public static SqlNthValueWindowFunctionExpressionNode NthValue(this SqlExpressionNode node, SqlExpressionNode n)

Parameters

node SqlExpressionNode

Expression to calculate the n-th value for.

n SqlExpressionNode

Row's position.

Returns

SqlNthValueWindowFunctionExpressionNode

New SqlNthValueWindowFunctionExpressionNode instance.

Or(SqlConditionNode, SqlConditionNode)

Creates a new SqlOrConditionNode instance.

[Pure]
public static SqlOrConditionNode Or(this SqlConditionNode node, SqlConditionNode right)

Parameters

node SqlConditionNode

First operand.

right SqlConditionNode

Second 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 TAggregateFunctionNode

Aggregate function node to decorate.

filter SqlConditionNode

Underlying 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 TAggregateFunctionNode

Aggregate 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 TAggregateFunctionNode

Aggregate 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 TAggregateFunctionNode

Aggregate function node to decorate.

window SqlWindowDefinitionNode

Underlying 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 SqlExpressionNode

Expression to raise to the desired power.

power SqlExpressionNode

Expression 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 SqlExpressionNode

Expression to replace occurrences in.

oldValue SqlExpressionNode

Value to replace.

newValue SqlExpressionNode

Replacement value.

Returns

SqlReplaceFunctionExpressionNode

New SqlReplaceFunctionExpressionNode instance.

Reverse(SqlExpressionNode)

Creates a new SqlReverseFunctionExpressionNode instance.

[Pure]
public static SqlReverseFunctionExpressionNode Reverse(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to reverse.

Returns

SqlReverseFunctionExpressionNode

New SqlReverseFunctionExpressionNode instance.

RightOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Right type.

[Pure]
public static SqlDataSourceJoinOnNode RightOn(this SqlRecordSetNode node, SqlConditionNode onExpression)

Parameters

node SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition 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 SqlExpressionNode

Expression to calculate the rounded value from.

precision SqlExpressionNode

Decimal rounding precision.

Returns

SqlRoundFunctionExpressionNode

New SqlRoundFunctionExpressionNode instance.

Sign(SqlExpressionNode)

Creates a new SqlSignFunctionExpressionNode instance.

[Pure]
public static SqlSignFunctionExpressionNode Sign(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression 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 SqlExpressionNode

Expression to calculate the square root from.

Returns

SqlSquareRootFunctionExpressionNode

New SqlSquareRootFunctionExpressionNode instance.

StringConcat(SqlExpressionNode, SqlExpressionNode?)

[Pure]
public static SqlStringConcatAggregateFunctionExpressionNode StringConcat(this SqlExpressionNode node, SqlExpressionNode? separator = null)

Parameters

node SqlExpressionNode

Expression to calculate the concatenated string for.

separator SqlExpressionNode

Optional 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 SqlExpressionNode

Expression to extract a substring from.

startIndex SqlExpressionNode

Position of the first character of the substring.

length SqlExpressionNode

Optional length of the substring. Equal to null by default.

Returns

SqlSubstringFunctionExpressionNode

New SqlSubstringFunctionExpressionNode instance.

Subtract(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlSubtractExpressionNode instance.

[Pure]
public static SqlSubtractExpressionNode Subtract(this SqlExpressionNode node, SqlExpressionNode right)

Parameters

node SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlSubtractExpressionNode

New SqlSubtractExpressionNode instance.

Sum(SqlExpressionNode)

Creates a new SqlSumAggregateFunctionExpressionNode instance.

[Pure]
public static SqlSumAggregateFunctionExpressionNode Sum(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to calculate the sum value for.

Returns

SqlSumAggregateFunctionExpressionNode

New SqlSumAggregateFunctionExpressionNode instance.

TemporalAdd(SqlExpressionNode, SqlExpressionNode, SqlTemporalUnit)

Creates a new SqlTemporalAddFunctionExpressionNode instance.

[Pure]
public static SqlTemporalAddFunctionExpressionNode TemporalAdd(this SqlExpressionNode node, SqlExpressionNode value, SqlTemporalUnit unit)

Parameters

node SqlExpressionNode

Expression to add value to.

value SqlExpressionNode

Value to add.

unit SqlTemporalUnit

SqlTemporalUnit that specifies the unit of the added value.

Returns

SqlTemporalAddFunctionExpressionNode

New SqlTemporalAddFunctionExpressionNode instance.

TemporalDiff(SqlExpressionNode, SqlExpressionNode, SqlTemporalUnit)

Creates a new SqlTemporalDiffFunctionExpressionNode instance.

[Pure]
public static SqlTemporalDiffFunctionExpressionNode TemporalDiff(this SqlExpressionNode node, SqlExpressionNode end, SqlTemporalUnit unit)

Parameters

node SqlExpressionNode

Expression that defines the start value.

end SqlExpressionNode

Expression that defines the end value.

unit SqlTemporalUnit

SqlTemporalUnit that specifies the unit of the returned result.

Returns

SqlTemporalDiffFunctionExpressionNode

New SqlTemporalDiffFunctionExpressionNode instance.

Then(SqlConditionNode, SqlExpressionNode)

Creates a new SqlSwitchCaseNode instance.

[Pure]
public static SqlSwitchCaseNode Then(this SqlConditionNode node, SqlExpressionNode value)

Parameters

node SqlConditionNode

Underlying condition.

value SqlExpressionNode

Underlying expression.

Returns

SqlSwitchCaseNode

New SqlSwitchCaseNode instance.

ToDataSource<TRecordSetNode>(TRecordSetNode)

[Pure]
public static SqlSingleDataSourceNode<TRecordSetNode> ToDataSource<TRecordSetNode>(this TRecordSetNode node) where TRecordSetNode : SqlRecordSetNode

Parameters

node TRecordSetNode

SqlRecordSetNode 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 SqlCreateIndexNode

Source index.

ifExists bool

Specifies 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 SqlCreateTableNode

Source table.

ifExists bool

Specifies 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 SqlCreateViewNode

Source view.

ifExists bool

Specifies 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 SqlSelectNode

Underlying 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 SqlValuesNode

SqlValuesNode source of records to be inserted.

recordSet SqlRecordSetNode

Table 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 SqlValuesNode

SqlValuesNode source of records to be inserted.

recordSet TRecordSetNode

Table 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 SqlExpressionNode

Expression to convert to lowercase.

Returns

SqlToLowerFunctionExpressionNode

New SqlToLowerFunctionExpressionNode instance.

ToQuery(SqlSelectFieldNode)

[Pure]
public static SqlDataSourceQueryExpressionNode<SqlDummyDataSourceNode> ToQuery(this SqlSelectFieldNode node)

Parameters

node SqlSelectFieldNode

Single 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 ISqlTableBuilder

Underlying ISqlTableBuilder instance.

alias string

Optional 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 ISqlViewBuilder

Underlying ISqlViewBuilder instance.

alias string

Optional 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 ISqlTable

Underlying ISqlTable instance.

alias string

Optional 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 ISqlView

Underlying ISqlView instance.

alias string

Optional 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 SqlRecordSetNode

Table to truncate.

Returns

SqlTruncateNode

New SqlTruncateNode instance.

ToUpper(SqlExpressionNode)

Creates a new SqlToUpperFunctionExpressionNode instance.

[Pure]
public static SqlToUpperFunctionExpressionNode ToUpper(this SqlExpressionNode node)

Parameters

node SqlExpressionNode

Expression to convert to uppercase.

Returns

SqlToUpperFunctionExpressionNode

New SqlToUpperFunctionExpressionNode instance.

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 SqlValuesNode

SqlValuesNode source of records to be inserted or updated.

recordSet SqlRecordSetNode

Table 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 SqlValuesNode

SqlValuesNode source of records to be inserted or updated.

recordSet TRecordSetNode

Table 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 SqlConditionNode

Underlying 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 SqlExpressionNode

Expression to trim at both ends.

characters SqlExpressionNode

Optional 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 SqlExpressionNode

Expression to trim at the end.

characters SqlExpressionNode

Optional characters to trim away. Equal to null by default.

Returns

SqlTrimEndFunctionExpressionNode

New SqlTrimEndFunctionExpressionNode instance.

TrimStart(SqlExpressionNode, SqlExpressionNode?)

Creates a new SqlTrimStartFunctionExpressionNode instance.

[Pure]
public static SqlTrimStartFunctionExpressionNode TrimStart(this SqlExpressionNode node, SqlExpressionNode? characters = null)

Parameters

node SqlExpressionNode

Expression to trim at the start.

characters SqlExpressionNode

Optional characters to trim away. Equal to null by default.

Returns

SqlTrimStartFunctionExpressionNode

New SqlTrimStartFunctionExpressionNode instance.

Truncate(SqlExpressionNode, SqlExpressionNode?)

Creates a new SqlTruncateFunctionExpressionNode instance.

[Pure]
public static SqlTruncateFunctionExpressionNode Truncate(this SqlExpressionNode node, SqlExpressionNode? precision = null)

Parameters

node SqlExpressionNode

Expression to calculate the truncated value from.

precision SqlExpressionNode

Optional decimal precision of the truncation. Equal to null by default.

Returns

SqlTruncateFunctionExpressionNode

New SqlTruncateFunctionExpressionNode instance.