Table of Contents

Class SqlNode

Namespace
LfrlAnvil.Sql.Expressions
Assembly
LfrlAnvil.Sql.Core.dll

Creates instances of SqlNodeBase type.

public static class SqlNode
Inheritance
SqlNode
Inherited Members

Methods

Add(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlAddExpressionNode instance.

[Pure]
public static SqlAddExpressionNode Add(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlAddExpressionNode

New SqlAddExpressionNode instance.

AddColumn(SqlRecordSetInfo, SqlColumnDefinitionNode)

Creates a new SqlAddColumnNode instance.

[Pure]
public static SqlAddColumnNode AddColumn(SqlRecordSetInfo table, SqlColumnDefinitionNode definition)

Parameters

table SqlRecordSetInfo

Source table.

definition SqlColumnDefinitionNode

Definition of the column to add.

Returns

SqlAddColumnNode

New SqlAddColumnNode instance.

AggregationFilterTrait(SqlConditionNode, bool)

Creates a new SqlAggregationFilterTraitNode instance.

[Pure]
public static SqlAggregationFilterTraitNode AggregationFilterTrait(SqlConditionNode filter, bool isConjunction)

Parameters

filter SqlConditionNode

Underlying predicate.

isConjunction bool

Specifies whether or not this trait should be merged with other SqlAggregationFilterTraitNode instances through an SqlAndConditionNode rather than an SqlOrConditionNode.

Returns

SqlAggregationFilterTraitNode

New SqlAggregationFilterTraitNode instance.

AggregationTrait(params SqlExpressionNode[])

Creates a new SqlAggregationTraitNode instance.

[Pure]
public static SqlAggregationTraitNode AggregationTrait(params SqlExpressionNode[] expressions)

Parameters

expressions SqlExpressionNode[]

Collection of expressions to aggregate by.

Returns

SqlAggregationTraitNode

New SqlAggregationTraitNode instance.

And(SqlConditionNode, SqlConditionNode)

Creates a new SqlAndConditionNode instance.

[Pure]
public static SqlAndConditionNode And(SqlConditionNode left, SqlConditionNode right)

Parameters

left SqlConditionNode

First operand.

right SqlConditionNode

Second operand.

Returns

SqlAndConditionNode

New SqlAndConditionNode instance.

Batch(params ISqlStatementNode[])

Creates a new SqlStatementBatchNode instance.

[Pure]
public static SqlStatementBatchNode Batch(params ISqlStatementNode[] statements)

Parameters

statements ISqlStatementNode[]

Collection of SQL statements.

Returns

SqlStatementBatchNode

New SqlStatementBatchNode instance.

BeginTransaction(IsolationLevel)

Creates a new SqlBeginTransactionNode instance.

[Pure]
public static SqlBeginTransactionNode BeginTransaction(IsolationLevel isolationLevel)

Parameters

isolationLevel IsolationLevel

Transaction's IsolationLevel.

Returns

SqlBeginTransactionNode

New SqlBeginTransactionNode instance.

Between(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode)

Creates a new SqlBetweenConditionNode instance.

[Pure]
public static SqlBetweenConditionNode Between(SqlExpressionNode value, SqlExpressionNode min, SqlExpressionNode max)

Parameters

value SqlExpressionNode

Value to check.

min SqlExpressionNode

Minimum acceptable value.

max SqlExpressionNode

Maximum acceptable value.

Returns

SqlBetweenConditionNode

New SqlBetweenConditionNode instance.

BitwiseAnd(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlBitwiseAndExpressionNode instance.

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

Parameters

left 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(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlBitwiseLeftShiftExpressionNode

New SqlBitwiseLeftShiftExpressionNode instance.

BitwiseNot(SqlExpressionNode)

Creates a new SqlBitwiseNotExpressionNode instance.

[Pure]
public static SqlBitwiseNotExpressionNode BitwiseNot(SqlExpressionNode value)

Parameters

value SqlExpressionNode

Operand.

Returns

SqlBitwiseNotExpressionNode

New SqlBitwiseNotExpressionNode instance.

BitwiseOr(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlBitwiseOrExpressionNode instance.

[Pure]
public static SqlBitwiseOrExpressionNode BitwiseOr(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left 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(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left 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(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlBitwiseXorExpressionNode

New SqlBitwiseXorExpressionNode instance.

Check(SqlSchemaObjectName, SqlConditionNode)

Creates a new SqlCheckDefinitionNode instance.

[Pure]
public static SqlCheckDefinitionNode Check(SqlSchemaObjectName name, SqlConditionNode condition)

Parameters

name SqlSchemaObjectName

Check constraint's name.

condition SqlConditionNode

Check constraint's condition.

Returns

SqlCheckDefinitionNode

New SqlCheckDefinitionNode instance.

Column(string, ISqlColumnTypeDefinition, bool, SqlExpressionNode?, SqlColumnComputation?)

Creates a new SqlColumnDefinitionNode instance.

[Pure]
public static SqlColumnDefinitionNode Column(string name, ISqlColumnTypeDefinition typeDefinition, bool isNullable = false, SqlExpressionNode? defaultValue = null, SqlColumnComputation? computation = null)

Parameters

name string

Column's name.

typeDefinition ISqlColumnTypeDefinition

ISqlColumnTypeDefinition instance that defines this column's type.

isNullable bool

Specifies whether or not this column should be nullable. Equal to false by default.

defaultValue SqlExpressionNode

Column's optional default value. Equal to null by default.

computation SqlColumnComputation?

Column's optional computation. Equal to null by default.

Returns

SqlColumnDefinitionNode

New SqlColumnDefinitionNode instance.

Column(string, TypeNullability, SqlExpressionNode?, SqlColumnComputation?)

Creates a new SqlColumnDefinitionNode instance.

[Pure]
public static SqlColumnDefinitionNode Column(string name, TypeNullability type, SqlExpressionNode? defaultValue = null, SqlColumnComputation? computation = null)

Parameters

name string

Column's name.

type TypeNullability

Column's runtime type.

defaultValue SqlExpressionNode

Column's optional default value. Equal to null by default.

computation SqlColumnComputation?

Column's optional computation. Equal to null by default.

Returns

SqlColumnDefinitionNode

New SqlColumnDefinitionNode instance.

Column<T>(string, bool, SqlExpressionNode?, SqlColumnComputation?)

Creates a new SqlColumnDefinitionNode instance.

[Pure]
public static SqlColumnDefinitionNode Column<T>(string name, bool isNullable = false, SqlExpressionNode? defaultValue = null, SqlColumnComputation? computation = null) where T : notnull

Parameters

name string

Column's name.

isNullable bool

Specifies whether or not this column should be nullable. Equal to false by default.

defaultValue SqlExpressionNode

Column's optional default value. Equal to null by default.

computation SqlColumnComputation?

Column's optional computation. Equal to null by default.

Returns

SqlColumnDefinitionNode

New SqlColumnDefinitionNode instance.

Type Parameters

T

Column's runtime type.

CommitTransaction()

Creates a new SqlCommitTransactionNode instance.

[Pure]
public static SqlCommitTransactionNode CommitTransaction()

Returns

SqlCommitTransactionNode

New SqlCommitTransactionNode instance.

CommonTableExpressionTrait(params SqlCommonTableExpressionNode[])

Creates a new SqlCommonTableExpressionTraitNode instance.

[Pure]
public static SqlCommonTableExpressionTraitNode CommonTableExpressionTrait(params SqlCommonTableExpressionNode[] commonTableExpressions)

Parameters

commonTableExpressions SqlCommonTableExpressionNode[]

Collection of common table expressions.

Returns

SqlCommonTableExpressionTraitNode

New SqlCommonTableExpressionTraitNode instance.

CompoundQuery(SqlQueryExpressionNode, params SqlCompoundQueryComponentNode[])

Creates a new SqlCompoundQueryExpressionNode instance.

[Pure]
public static SqlCompoundQueryExpressionNode CompoundQuery(SqlQueryExpressionNode firstQuery, params SqlCompoundQueryComponentNode[] followingQueries)

Parameters

firstQuery SqlQueryExpressionNode

First underlying query.

followingQueries SqlCompoundQueryComponentNode[]

Collection of queries that sequentially follow after the first query.

Returns

SqlCompoundQueryExpressionNode

New SqlCompoundQueryExpressionNode instance.

CompoundWith(SqlCompoundQueryOperator, SqlQueryExpressionNode)

Creates a new SqlCompoundQueryComponentNode instance.

[Pure]
public static SqlCompoundQueryComponentNode CompoundWith(SqlCompoundQueryOperator @operator, SqlQueryExpressionNode query)

Parameters

operator SqlCompoundQueryOperator

Compound query operator with which this query should be included.

query SqlQueryExpressionNode

Underlying query.

Returns

SqlCompoundQueryComponentNode

New SqlCompoundQueryComponentNode instance.

Concat(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlConcatExpressionNode instance.

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

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlConcatExpressionNode

New SqlConcatExpressionNode instance.

CreateIndex(SqlSchemaObjectName, bool, SqlRecordSetNode, ReadOnlyArray<SqlOrderByNode>, bool, SqlConditionNode?)

Creates a new SqlCreateIndexNode instance.

[Pure]
public static SqlCreateIndexNode CreateIndex(SqlSchemaObjectName name, bool isUnique, SqlRecordSetNode table, ReadOnlyArray<SqlOrderByNode> columns, bool replaceIfExists = false, SqlConditionNode? filter = null)

Parameters

name SqlSchemaObjectName

Index's name.

isUnique bool

Specifies whether or not this index is unique.

table SqlRecordSetNode

Table on which this index is created.

columns ReadOnlyArray<SqlOrderByNode>

Collection of expressions that define this index.

replaceIfExists bool

Specifies whether or not the index should be replaced if it already exists in DB. Equal to false by default.

filter SqlConditionNode

Optional filter condition. Equal to null by default.

Returns

SqlCreateIndexNode

New SqlCreateIndexNode instance.

CreateTable(SqlRecordSetInfo, SqlColumnDefinitionNode[], bool, Func<SqlNewTableNode, SqlCreateTableConstraints>?)

Creates a new SqlCreateTableNode instance.

[Pure]
public static SqlCreateTableNode CreateTable(SqlRecordSetInfo info, SqlColumnDefinitionNode[] columns, bool ifNotExists = false, Func<SqlNewTableNode, SqlCreateTableConstraints>? constraintsProvider = null)

Parameters

info SqlRecordSetInfo

Table's name.

columns SqlColumnDefinitionNode[]

Collection of columns.

ifNotExists bool

Specifies whether or not this table should only be created if it does not already exist in DB. Equal to false by default.

constraintsProvider Func<SqlNewTableNode, SqlCreateTableConstraints>

Optional SqlCreateTableConstraints provider.

Returns

SqlCreateTableNode

New SqlCreateTableNode instance.

CreateView(SqlRecordSetInfo, SqlQueryExpressionNode, bool)

Creates a new SqlCreateViewNode instance.

[Pure]
public static SqlCreateViewNode CreateView(SqlRecordSetInfo info, SqlQueryExpressionNode source, bool replaceIfExists = false)

Parameters

info SqlRecordSetInfo

View's name.

source SqlQueryExpressionNode

Underlying source query expression that defines this view.

replaceIfExists bool

Specifies whether or not the view should be replaced if it already exists in DB. Equal to false by default.

Returns

SqlCreateViewNode

New SqlCreateViewNode instance.

CrossJoin(SqlRecordSetNode)

Creates a new SqlDataSourceJoinOnNode instance with Cross type.

[Pure]
public static SqlDataSourceJoinOnNode CrossJoin(SqlRecordSetNode innerRecordSet)

Parameters

innerRecordSet SqlRecordSetNode

Inner SqlRecordSetNode instance.

Returns

SqlDataSourceJoinOnNode

New SqlDataSourceJoinOnNode instance.

DeleteFrom(SqlDataSourceNode)

Creates a new SqlDeleteFromNode instance.

[Pure]
public static SqlDeleteFromNode DeleteFrom(SqlDataSourceNode dataSource)

Parameters

dataSource SqlDataSourceNode

Data source that defines records to be deleted.

Returns

SqlDeleteFromNode

New SqlDeleteFromNode instance.

DistinctTrait()

Creates a new SqlDistinctTraitNode instance.

[Pure]
public static SqlDistinctTraitNode DistinctTrait()

Returns

SqlDistinctTraitNode

New SqlDistinctTraitNode instance.

Divide(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlDivideExpressionNode instance.

[Pure]
public static SqlDivideExpressionNode Divide(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlDivideExpressionNode

New SqlDivideExpressionNode instance.

DropColumn(SqlRecordSetInfo, string)

Creates a new SqlDropColumnNode instance.

[Pure]
public static SqlDropColumnNode DropColumn(SqlRecordSetInfo table, string name)

Parameters

table SqlRecordSetInfo

Source table.

name string

Column's name.

Returns

SqlDropColumnNode

New SqlDropColumnNode instance.

DropIndex(SqlRecordSetInfo, SqlSchemaObjectName, bool)

Creates a new SqlDropIndexNode instance.

[Pure]
public static SqlDropIndexNode DropIndex(SqlRecordSetInfo table, SqlSchemaObjectName name, bool ifExists = false)

Parameters

table SqlRecordSetInfo

Source table.

name SqlSchemaObjectName

Index's name.

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.

DropTable(SqlRecordSetInfo, bool)

Creates a new SqlDropTableNode instance.

[Pure]
public static SqlDropTableNode DropTable(SqlRecordSetInfo table, bool ifExists = false)

Parameters

table SqlRecordSetInfo

Table's name.

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.

DropView(SqlRecordSetInfo, bool)

Creates a new SqlDropViewNode instance.

[Pure]
public static SqlDropViewNode DropView(SqlRecordSetInfo view, bool ifExists = false)

Parameters

view SqlRecordSetInfo

View's name.

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.

DummyDataSource()

Creates a new SqlDummyDataSourceNode instance.

[Pure]
public static SqlDummyDataSourceNode DummyDataSource()

Returns

SqlDummyDataSourceNode

New SqlDummyDataSourceNode instance.

EqualTo(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlEqualToConditionNode instance.

[Pure]
public static SqlEqualToConditionNode EqualTo(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlEqualToConditionNode

New SqlEqualToConditionNode instance.

ExceptWith(SqlQueryExpressionNode)

Creates a new SqlCompoundQueryComponentNode instance with Except operator.

[Pure]
public static SqlCompoundQueryComponentNode ExceptWith(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

Underlying query.

Returns

SqlCompoundQueryComponentNode

New SqlCompoundQueryComponentNode instance.

Exists(SqlQueryExpressionNode)

Creates a new SqlExistsConditionNode instance.

[Pure]
public static SqlExistsConditionNode Exists(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

Sub-query to check.

Returns

SqlExistsConditionNode

New SqlExistsConditionNode instance.

False()

Creates a new SqlFalseNode instance.

[Pure]
public static SqlFalseNode False()

Returns

SqlFalseNode

New SqlFalseNode instance.

FilterTrait(SqlConditionNode, bool)

Creates a new SqlFilterTraitNode instance.

[Pure]
public static SqlFilterTraitNode FilterTrait(SqlConditionNode filter, bool isConjunction)

Parameters

filter SqlConditionNode

Underlying predicate.

isConjunction bool

Specifies whether or not this trait should be merged with other SqlFilterTraitNode instances through an SqlAndConditionNode rather than an SqlOrConditionNode.

Returns

SqlFilterTraitNode

New SqlFilterTraitNode instance.

ForeignKey(SqlSchemaObjectName, SqlDataFieldNode[], SqlRecordSetNode, SqlDataFieldNode[], ReferenceBehavior?, ReferenceBehavior?)

Creates a new SqlForeignKeyDefinitionNode instance.

[Pure]
public static SqlForeignKeyDefinitionNode ForeignKey(SqlSchemaObjectName name, SqlDataFieldNode[] columns, SqlRecordSetNode referencedTable, SqlDataFieldNode[] referencedColumns, ReferenceBehavior? onDeleteBehavior = null, ReferenceBehavior? onUpdateBehavior = null)

Parameters

name SqlSchemaObjectName

Foreign key constraint's name.

columns SqlDataFieldNode[]

Collection of columns from source table that this foreign key originates from.

referencedTable SqlRecordSetNode

Table referenced by this foreign key constraint.

referencedColumns SqlDataFieldNode[]

Collection of columns from referenced table referenced by this foreign key constraint.

onDeleteBehavior ReferenceBehavior

Specifies this foreign key constraint's on delete behavior. Equal to Restrict by default.

onUpdateBehavior ReferenceBehavior

Specifies this foreign key constraint's on update behavior. Equal to Restrict by default.

Returns

SqlForeignKeyDefinitionNode

New SqlForeignKeyDefinitionNode instance.

FullJoinOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Full type.

[Pure]
public static SqlDataSourceJoinOnNode FullJoinOn(SqlRecordSetNode innerRecordSet, SqlConditionNode onExpression)

Parameters

innerRecordSet SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition of this join operation.

Returns

SqlDataSourceJoinOnNode

New SqlDataSourceJoinOnNode instance.

GreaterThan(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlGreaterThanConditionNode instance.

[Pure]
public static SqlGreaterThanConditionNode GreaterThan(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlGreaterThanConditionNode

New SqlGreaterThanConditionNode instance.

GreaterThanOrEqualTo(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlGreaterThanOrEqualToConditionNode instance.

[Pure]
public static SqlGreaterThanOrEqualToConditionNode GreaterThanOrEqualTo(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlGreaterThanOrEqualToConditionNode

New SqlGreaterThanOrEqualToConditionNode instance.

Iif(SqlConditionNode, SqlExpressionNode, SqlExpressionNode)

Creates a new SqlSwitchExpressionNode instance.

[Pure]
public static SqlSwitchExpressionNode Iif(SqlConditionNode condition, SqlExpressionNode whenTrue, SqlExpressionNode whenFalse)

Parameters

condition SqlConditionNode

Underlying condition.

whenTrue SqlExpressionNode

Expression to be returned when the condition returns true.

whenFalse SqlExpressionNode

Expression to be returned when the condition returns false.

Returns

SqlSwitchExpressionNode

New SqlSwitchExpressionNode instance.

In(SqlExpressionNode, params SqlExpressionNode[])

Creates a new SqlInConditionNode instance or SqlFalseNode when expressions are empty.

[Pure]
public static SqlConditionNode In(SqlExpressionNode value, params SqlExpressionNode[] expressions)

Parameters

value SqlExpressionNode

Value to check.

expressions 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(SqlExpressionNode value, SqlQueryExpressionNode query)

Parameters

value SqlExpressionNode

Value to check.

query SqlQueryExpressionNode

Sub-query that the value is compared against.

Returns

SqlInQueryConditionNode

New SqlInQueryConditionNode instance.

InnerJoinOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Inner type.

[Pure]
public static SqlDataSourceJoinOnNode InnerJoinOn(SqlRecordSetNode innerRecordSet, SqlConditionNode onExpression)

Parameters

innerRecordSet SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition of this join operation.

Returns

SqlDataSourceJoinOnNode

New SqlDataSourceJoinOnNode instance.

InsertInto(SqlQueryExpressionNode, SqlRecordSetNode, params SqlDataFieldNode[])

Creates a new SqlInsertIntoNode instance.

[Pure]
public static SqlInsertIntoNode InsertInto(SqlQueryExpressionNode query, SqlRecordSetNode recordSet, params SqlDataFieldNode[] dataFields)

Parameters

query SqlQueryExpressionNode

SqlQueryExpressionNode 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.

InsertInto(SqlValuesNode, SqlRecordSetNode, params SqlDataFieldNode[])

Creates a new SqlInsertIntoNode instance.

[Pure]
public static SqlInsertIntoNode InsertInto(SqlValuesNode values, SqlRecordSetNode recordSet, params SqlDataFieldNode[] dataFields)

Parameters

values 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.

IntersectWith(SqlQueryExpressionNode)

Creates a new SqlCompoundQueryComponentNode instance with Intersect operator.

[Pure]
public static SqlCompoundQueryComponentNode IntersectWith(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

Underlying query.

Returns

SqlCompoundQueryComponentNode

New SqlCompoundQueryComponentNode instance.

Join(SqlDataSourceNode, params SqlDataSourceJoinOnNode[])

Creates a new SqlMultiDataSourceNode instance.

[Pure]
public static SqlMultiDataSourceNode Join(SqlDataSourceNode from, params SqlDataSourceJoinOnNode[] joins)

Parameters

from 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(SqlDataSourceNode from, params SqlJoinDefinition[] definitions)

Parameters

from 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(SqlRecordSetNode, params SqlDataSourceJoinOnNode[])

Creates a new SqlMultiDataSourceNode instance.

[Pure]
public static SqlMultiDataSourceNode Join(SqlRecordSetNode from, params SqlDataSourceJoinOnNode[] joins)

Parameters

from 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(SqlRecordSetNode from, params SqlJoinDefinition[] definitions)

Parameters

from 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.

LeftJoinOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Left type.

[Pure]
public static SqlDataSourceJoinOnNode LeftJoinOn(SqlRecordSetNode innerRecordSet, SqlConditionNode onExpression)

Parameters

innerRecordSet SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition of this join operation.

Returns

SqlDataSourceJoinOnNode

New SqlDataSourceJoinOnNode instance.

LessThan(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlLessThanConditionNode instance.

[Pure]
public static SqlLessThanConditionNode LessThan(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlLessThanConditionNode

New SqlLessThanConditionNode instance.

LessThanOrEqualTo(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlLessThanOrEqualToConditionNode instance.

[Pure]
public static SqlLessThanOrEqualToConditionNode LessThanOrEqualTo(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlLessThanOrEqualToConditionNode

New SqlLessThanOrEqualToConditionNode instance.

Like(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode?)

Creates a new SqlLikeConditionNode instance.

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

Parameters

value 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.

LimitTrait(SqlExpressionNode)

Creates a new SqlLimitTraitNode instance.

[Pure]
public static SqlLimitTraitNode LimitTrait(SqlExpressionNode value)

Parameters

value SqlExpressionNode

Underlying value.

Returns

SqlLimitTraitNode

New SqlLimitTraitNode instance.

Literal<T>(T?)

Creates a new SqlLiteralNode<T> instance or SqlNullNode instance when value is null.

[Pure]
public static SqlExpressionNode Literal<T>(T? value) where T : struct

Parameters

value T?

Underlying value.

Returns

SqlExpressionNode

New SqlLiteralNode<T> instance or SqlNullNode instance.

Type Parameters

T

Value type.

Literal<T>(T?)

Creates a new SqlLiteralNode<T> instance or SqlNullNode instance when value is null.

[Pure]
public static SqlExpressionNode Literal<T>(T? value) where T : notnull

Parameters

value T

Underlying value.

Returns

SqlExpressionNode

New SqlLiteralNode<T> instance or SqlNullNode instance.

Type Parameters

T

Value type.

Modulo(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlModuloExpressionNode instance.

[Pure]
public static SqlModuloExpressionNode Modulo(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left 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(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlMultiplyExpressionNode

New SqlMultiplyExpressionNode instance.

NamedFunctionRecordSet(SqlNamedFunctionExpressionNode, string)

Creates a new SqlNamedFunctionRecordSetNode instance.

[Pure]
public static SqlNamedFunctionRecordSetNode NamedFunctionRecordSet(SqlNamedFunctionExpressionNode function, string alias)

Parameters

function SqlNamedFunctionExpressionNode

Underlying SqlNamedFunctionExpressionNode instance.

alias string

Alias of this record set.

Returns

SqlNamedFunctionRecordSetNode

New SqlNamedFunctionRecordSetNode instance.

Negate(SqlExpressionNode)

Creates a new SqlNegateExpressionNode instance.

[Pure]
public static SqlNegateExpressionNode Negate(SqlExpressionNode value)

Parameters

value SqlExpressionNode

Operand.

Returns

SqlNegateExpressionNode

New SqlNegateExpressionNode instance.

NewTableRecordSet(SqlCreateTableNode, string?)

Creates a new SqlNewTableNode instance.

[Pure]
public static SqlNewTableNode NewTableRecordSet(SqlCreateTableNode creationNode, string? alias = null)

Parameters

creationNode SqlCreateTableNode

Underlying SqlCreateTableNode instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlNewTableNode

New SqlNewTableNode instance.

NewViewRecordSet(SqlCreateViewNode, string?)

Creates a new SqlNewViewNode instance.

[Pure]
public static SqlNewViewNode NewViewRecordSet(SqlCreateViewNode creationNode, string? alias = null)

Parameters

creationNode SqlCreateViewNode

Underlying SqlCreateViewNode instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlNewViewNode

New SqlNewViewNode instance.

NotBetween(SqlExpressionNode, SqlExpressionNode, SqlExpressionNode)

Creates a new negated SqlBetweenConditionNode instance.

[Pure]
public static SqlBetweenConditionNode NotBetween(SqlExpressionNode value, SqlExpressionNode min, SqlExpressionNode max)

Parameters

value SqlExpressionNode

Value to check.

min SqlExpressionNode

Minimum acceptable value.

max SqlExpressionNode

Maximum acceptable value.

Returns

SqlBetweenConditionNode

New negated SqlBetweenConditionNode instance.

NotEqualTo(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlNotEqualToConditionNode instance.

[Pure]
public static SqlNotEqualToConditionNode NotEqualTo(SqlExpressionNode left, SqlExpressionNode right)

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlNotEqualToConditionNode

New SqlNotEqualToConditionNode instance.

NotExists(SqlQueryExpressionNode)

Creates a new negated SqlExistsConditionNode instance.

[Pure]
public static SqlExistsConditionNode NotExists(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

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(SqlExpressionNode value, params SqlExpressionNode[] expressions)

Parameters

value SqlExpressionNode

Value to check.

expressions 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(SqlExpressionNode value, SqlQueryExpressionNode query)

Parameters

value 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(SqlExpressionNode value, SqlExpressionNode pattern, SqlExpressionNode? escape = null)

Parameters

value 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.

Null()

Creates a new SqlNullNode instance.

[Pure]
public static SqlNullNode Null()

Returns

SqlNullNode

New SqlNullNode instance.

OffsetTrait(SqlExpressionNode)

Creates a new SqlOffsetTraitNode instance.

[Pure]
public static SqlOffsetTraitNode OffsetTrait(SqlExpressionNode value)

Parameters

value SqlExpressionNode

Underlying value.

Returns

SqlOffsetTraitNode

New SqlOffsetTraitNode instance.

Or(SqlConditionNode, SqlConditionNode)

Creates a new SqlOrConditionNode instance.

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

Parameters

left SqlConditionNode

First operand.

right SqlConditionNode

Second operand.

Returns

SqlOrConditionNode

New SqlOrConditionNode instance.

OrderBy(SqlExpressionNode, OrderBy)

Creates a new SqlOrderByNode instance.

[Pure]
public static SqlOrderByNode OrderBy(SqlExpressionNode expression, OrderBy ordering)

Parameters

expression SqlExpressionNode

Underlying expression.

ordering OrderBy

Ordering used by this definition.

Returns

SqlOrderByNode

New SqlOrderByNode instance.

OrderByAsc(SqlExpressionNode)

Creates a new SqlOrderByNode instance with Asc ordering.

[Pure]
public static SqlOrderByNode OrderByAsc(SqlExpressionNode expression)

Parameters

expression SqlExpressionNode

Underlying expression.

Returns

SqlOrderByNode

New SqlOrderByNode instance.

OrderByDesc(SqlExpressionNode)

Creates a new SqlOrderByNode instance with Desc ordering.

[Pure]
public static SqlOrderByNode OrderByDesc(SqlExpressionNode expression)

Parameters

expression SqlExpressionNode

Underlying expression.

Returns

SqlOrderByNode

New SqlOrderByNode instance.

OrdinalCommonTableExpression(SqlQueryExpressionNode, string)

Creates a new SqlOrdinalCommonTableExpressionNode instance.

[Pure]
public static SqlOrdinalCommonTableExpressionNode OrdinalCommonTableExpression(SqlQueryExpressionNode query, string name)

Parameters

query SqlQueryExpressionNode

Underlying query that defines this common table expression.

name string

Name of this common table expression.

Returns

SqlOrdinalCommonTableExpressionNode

New SqlOrdinalCommonTableExpressionNode instance.

Parameter(string, TypeNullability?, int?)

Creates a new SqlParameterNode instance.

[Pure]
public static SqlParameterNode Parameter(string name, TypeNullability? type = null, int? index = null)

Parameters

name string

Parameter's name.

type TypeNullability?

Optional runtime type of this parameter. Equal to null by default.

index int?

Optional 0-based position of this parameter. Non-null values mean that the parameter may be interpreted as a positional parameter. Equal to null by default.

Returns

SqlParameterNode

New SqlParameterNode instance.

ParameterRange(string, int, TypeNullability?, int?)

Creates a new collection of SqlParameterNode instances.

[Pure]
public static SqlParameterNode[] ParameterRange(string name, int count, TypeNullability? type = null, int? firstIndex = null)

Parameters

name string

Base name of all parameters.

count int

Number of parameters.

type TypeNullability?

Optional runtime type of all parameters. Equal to null by default.

firstIndex int?

Optional 0-based position of the first parameter. Non-null values mean that the parameter may be interpreted as a positional parameter. Equal to null by default.

Returns

SqlParameterNode[]

New collection of SqlParameterNode instances.

Exceptions

ArgumentOutOfRangeException

When count is less than 0.

ParameterRange<T>(string, int, bool, int?)

Creates a new collection of SqlParameterNode instances.

[Pure]
public static SqlParameterNode[] ParameterRange<T>(string name, int count, bool isNullable = false, int? firstIndex = null)

Parameters

name string

Base name of all parameters.

count int

Number of parameters.

isNullable bool

Specifies whether or not all parameters should be nullable. Equal to false by default.

firstIndex int?

Optional 0-based position of the first parameter. Non-null values mean that the parameter may be interpreted as a positional parameter. Equal to null by default.

Returns

SqlParameterNode[]

New collection of SqlParameterNode instances.

Type Parameters

T

Value type.

Exceptions

ArgumentOutOfRangeException

When count is less than 0.

Parameter<T>(string, bool, int?)

Creates a new SqlParameterNode instance.

[Pure]
public static SqlParameterNode Parameter<T>(string name, bool isNullable = false, int? index = null)

Parameters

name string

Parameter's name.

isNullable bool

Specifies whether or not this parameter should be nullable. Equal to false by default.

index int?

Optional 0-based position of this parameter. Non-null values mean that the parameter may be interpreted as a positional parameter. Equal to null by default.

Returns

SqlParameterNode

New SqlParameterNode instance.

Type Parameters

T

Value type.

PrimaryKey(SqlSchemaObjectName, ReadOnlyArray<SqlOrderByNode>)

Creates a new SqlPrimaryKeyDefinitionNode instance.

[Pure]
public static SqlPrimaryKeyDefinitionNode PrimaryKey(SqlSchemaObjectName name, ReadOnlyArray<SqlOrderByNode> columns)

Parameters

name SqlSchemaObjectName

Primary key constraint's name.

columns ReadOnlyArray<SqlOrderByNode>

Collection of columns that define this primary key constraint.

Returns

SqlPrimaryKeyDefinitionNode

New SqlPrimaryKeyDefinitionNode instance.

QueryRecordSet(SqlQueryExpressionNode, string)

Creates a new SqlQueryRecordSetNode instance.

[Pure]
public static SqlQueryRecordSetNode QueryRecordSet(SqlQueryExpressionNode query, string alias)

Parameters

query SqlQueryExpressionNode

Underlying SqlQueryExpressionNode instance.

alias string

Alias of this record set.

Returns

SqlQueryRecordSetNode

New SqlQueryRecordSetNode instance.

Query<TDataSourceNode>(TDataSourceNode, params SqlSelectNode[])

[Pure]
public static SqlDataSourceQueryExpressionNode<TDataSourceNode> Query<TDataSourceNode>(TDataSourceNode dataSource, params SqlSelectNode[] selection) where TDataSourceNode : SqlDataSourceNode

Parameters

dataSource TDataSourceNode

Underlying data source.

selection SqlSelectNode[]

Collection of expressions to include in this query's selection.

Returns

SqlDataSourceQueryExpressionNode<TDataSourceNode>

New SqlDataSourceQueryExpressionNode<TDataSourceNode> instance.

Type Parameters

TDataSourceNode

SQL data source node type.

RangeWindowFrame(SqlWindowFrameBoundary, SqlWindowFrameBoundary)

Creates a new SqlWindowFrameNode instance with Range type.

[Pure]
public static SqlWindowFrameNode RangeWindowFrame(SqlWindowFrameBoundary start, SqlWindowFrameBoundary end)

Parameters

start SqlWindowFrameBoundary

Beginning SqlWindowFrameBoundary of this frame.

end SqlWindowFrameBoundary

Ending SqlWindowFrameBoundary of this frame.

Returns

SqlWindowFrameNode

New SqlWindowFrameNode instance.

RawCondition(string, params SqlParameterNode[])

Creates a new SqlRawConditionNode instance.

[Pure]
public static SqlRawConditionNode RawCondition(string sql, params SqlParameterNode[] parameters)

Parameters

sql string

Raw SQL condition.

parameters SqlParameterNode[]

Collection of parameter nodes.

Returns

SqlRawConditionNode

New SqlRawConditionNode instance.

RawDataField(SqlRecordSetNode, string, TypeNullability?)

Creates a new SqlRawDataFieldNode instance.

[Pure]
public static SqlRawDataFieldNode RawDataField(SqlRecordSetNode recordSet, string name, TypeNullability? type = null)

Parameters

recordSet 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.

RawExpression(string, params SqlParameterNode[])

Creates a new SqlRawExpressionNode instance.

[Pure]
public static SqlRawExpressionNode RawExpression(string sql, params SqlParameterNode[] parameters)

Parameters

sql string

Raw SQL expression.

parameters SqlParameterNode[]

Collection of parameter nodes.

Returns

SqlRawExpressionNode

New SqlRawExpressionNode instance.

RawExpression(string, TypeNullability?, params SqlParameterNode[])

Creates a new SqlRawExpressionNode instance.

[Pure]
public static SqlRawExpressionNode RawExpression(string sql, TypeNullability? type, params SqlParameterNode[] parameters)

Parameters

sql string

Raw SQL expression.

type TypeNullability?

Optional runtime type of the result of this expression.

parameters SqlParameterNode[]

Collection of parameter nodes.

Returns

SqlRawExpressionNode

New SqlRawExpressionNode instance.

RawQuery(string, params SqlParameterNode[])

Creates a new SqlRawQueryExpressionNode instance.

[Pure]
public static SqlRawQueryExpressionNode RawQuery(string sql, params SqlParameterNode[] parameters)

Parameters

sql string

Raw SQL query expression.

parameters SqlParameterNode[]

Collection of parameter nodes.

Returns

SqlRawQueryExpressionNode

New SqlRawQueryExpressionNode instance.

RawRecordSet(SqlRecordSetInfo, string?)

Creates a new SqlRawRecordSetNode instance.

[Pure]
public static SqlRawRecordSetNode RawRecordSet(SqlRecordSetInfo info, string? alias = null)

Parameters

info SqlRecordSetInfo

SqlRecordSetInfo associated with this record set.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlRawRecordSetNode

New SqlRawRecordSetNode instance.

RawRecordSet(string, string?)

Creates a new SqlRawRecordSetNode instance marked as raw.

[Pure]
public static SqlRawRecordSetNode RawRecordSet(string name, string? alias = null)

Parameters

name string

Raw name of this record set.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlRawRecordSetNode

New SqlRawRecordSetNode instance.

RawStatement(string, params SqlParameterNode[])

Creates a new SqlRawStatementNode instance.

[Pure]
public static SqlRawStatementNode RawStatement(string sql, params SqlParameterNode[] parameters)

Parameters

sql string

Raw SQL statement.

parameters SqlParameterNode[]

Collection of parameter nodes.

Returns

SqlRawStatementNode

New SqlRawStatementNode instance.

RecursiveCommonTableExpression(SqlCompoundQueryExpressionNode, string)

Creates a new SqlRecursiveCommonTableExpressionNode instance.

[Pure]
public static SqlRecursiveCommonTableExpressionNode RecursiveCommonTableExpression(SqlCompoundQueryExpressionNode query, string name)

Parameters

query SqlCompoundQueryExpressionNode

Underlying query that defines this common table expression.

name string

Name of this common table expression.

Returns

SqlRecursiveCommonTableExpressionNode

New SqlRecursiveCommonTableExpressionNode instance.

RenameColumn(SqlRecordSetInfo, string, string)

Creates a new SqlRenameColumnNode instance.

[Pure]
public static SqlRenameColumnNode RenameColumn(SqlRecordSetInfo table, string oldName, string newName)

Parameters

table SqlRecordSetInfo

Source table.

oldName string

Column's new name.

newName string

Column's new name.

Returns

SqlRenameColumnNode

New SqlRenameColumnNode instance.

RenameTable(SqlRecordSetInfo, SqlSchemaObjectName)

Creates a new SqlRenameTableNode instance.

[Pure]
public static SqlRenameTableNode RenameTable(SqlRecordSetInfo info, SqlSchemaObjectName newName)

Parameters

info SqlRecordSetInfo

Table's old name.

newName SqlSchemaObjectName

Table's new name.

Returns

SqlRenameTableNode

New SqlRenameTableNode instance.

RightJoinOn(SqlRecordSetNode, SqlConditionNode)

Creates a new SqlDataSourceJoinOnNode instance with Right type.

[Pure]
public static SqlDataSourceJoinOnNode RightJoinOn(SqlRecordSetNode innerRecordSet, SqlConditionNode onExpression)

Parameters

innerRecordSet SqlRecordSetNode

Inner SqlRecordSetNode instance.

onExpression SqlConditionNode

Condition of this join operation.

Returns

SqlDataSourceJoinOnNode

New SqlDataSourceJoinOnNode instance.

RollbackTransaction()

Creates a new SqlRollbackTransactionNode instance.

[Pure]
public static SqlRollbackTransactionNode RollbackTransaction()

Returns

SqlRollbackTransactionNode

New SqlRollbackTransactionNode instance.

RowsWindowFrame(SqlWindowFrameBoundary, SqlWindowFrameBoundary)

Creates a new SqlWindowFrameNode instance with Rows type.

[Pure]
public static SqlWindowFrameNode RowsWindowFrame(SqlWindowFrameBoundary start, SqlWindowFrameBoundary end)

Parameters

start SqlWindowFrameBoundary

Beginning SqlWindowFrameBoundary of this frame.

end SqlWindowFrameBoundary

Ending SqlWindowFrameBoundary of this frame.

Returns

SqlWindowFrameNode

New SqlWindowFrameNode instance.

Select(SqlDataFieldNode, string?)

Creates a new SqlSelectFieldNode instance.

[Pure]
public static SqlSelectFieldNode Select(SqlDataFieldNode dataField, string? alias = null)

Parameters

dataField SqlDataFieldNode

Selected data field.

alias string

Optional alias of the selected expression. Equal to null by default.

Returns

SqlSelectFieldNode

New SqlSelectFieldNode instance.

Select(SqlExpressionNode, string)

Creates a new SqlSelectFieldNode instance.

[Pure]
public static SqlSelectFieldNode Select(SqlExpressionNode expression, string alias)

Parameters

expression SqlExpressionNode

Selected expression.

alias string

Alias of the selected expression.

Returns

SqlSelectFieldNode

New SqlSelectFieldNode instance.

SelectAll(SqlDataSourceNode)

Creates a new SqlSelectAllNode instance.

[Pure]
public static SqlSelectAllNode SelectAll(SqlDataSourceNode dataSource)

Parameters

dataSource SqlDataSourceNode

Data source to select all data fields from.

Returns

SqlSelectAllNode

New SqlSelectAllNode instance.

SelectAll(SqlRecordSetNode)

Creates a new SqlSelectRecordSetNode instance.

[Pure]
public static SqlSelectRecordSetNode SelectAll(SqlRecordSetNode recordSet)

Parameters

recordSet SqlRecordSetNode

Single record set to select all data fields from.

Returns

SqlSelectRecordSetNode

New SqlSelectRecordSetNode instance.

SelectExpression(SqlSelectNode)

Creates a new SqlSelectExpressionNode instance.

[Pure]
public static SqlSelectExpressionNode SelectExpression(SqlSelectNode selectNode)

Parameters

selectNode SqlSelectNode

Underlying selection.

Returns

SqlSelectExpressionNode

New SqlSelectExpressionNode instance.

SingleDataSource<TRecordSetNode>(TRecordSetNode)

[Pure]
public static SqlSingleDataSourceNode<TRecordSetNode> SingleDataSource<TRecordSetNode>(TRecordSetNode from) where TRecordSetNode : SqlRecordSetNode

Parameters

from 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.

SortTrait(params SqlOrderByNode[])

Creates a new SqlSortTraitNode instance.

[Pure]
public static SqlSortTraitNode SortTrait(params SqlOrderByNode[] ordering)

Parameters

ordering SqlOrderByNode[]

Collection of ordering definitions.

Returns

SqlSortTraitNode

New SqlSortTraitNode instance.

Subtract(SqlExpressionNode, SqlExpressionNode)

Creates a new SqlSubtractExpressionNode instance.

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

Parameters

left SqlExpressionNode

First operand.

right SqlExpressionNode

Second operand.

Returns

SqlSubtractExpressionNode

New SqlSubtractExpressionNode instance.

Switch(IEnumerable<SqlSwitchCaseNode>, SqlExpressionNode)

Creates a new SqlSwitchExpressionNode instance.

[Pure]
public static SqlSwitchExpressionNode Switch(IEnumerable<SqlSwitchCaseNode> cases, SqlExpressionNode defaultExpression)

Parameters

cases IEnumerable<SqlSwitchCaseNode>

Collection of cases.

defaultExpression SqlExpressionNode

Default expression.

Returns

SqlSwitchExpressionNode

New SqlSwitchExpressionNode instance.

SwitchCase(SqlConditionNode, SqlExpressionNode)

Creates a new SqlSwitchCaseNode instance.

[Pure]
public static SqlSwitchCaseNode SwitchCase(SqlConditionNode condition, SqlExpressionNode expression)

Parameters

condition SqlConditionNode

Underlying condition.

expression SqlExpressionNode

Underlying expression.

Returns

SqlSwitchCaseNode

New SqlSwitchCaseNode instance.

Table(ISqlTableBuilder, string?)

Creates a new SqlTableBuilderNode instance.

[Pure]
public static SqlTableBuilderNode Table(ISqlTableBuilder value, string? alias = null)

Parameters

value ISqlTableBuilder

Underlying ISqlTableBuilder instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlTableBuilderNode

New SqlTableBuilderNode instance.

Table(ISqlTable, string?)

Creates a new SqlTableNode instance.

[Pure]
public static SqlTableNode Table(ISqlTable value, string? alias = null)

Parameters

value ISqlTable

Underlying ISqlTable instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlTableNode

New SqlTableNode instance.

True()

Creates a new SqlTrueNode instance.

[Pure]
public static SqlTrueNode True()

Returns

SqlTrueNode

New SqlTrueNode instance.

Truncate(SqlRecordSetNode)

Creates a new SqlTruncateNode instance.

[Pure]
public static SqlTruncateNode Truncate(SqlRecordSetNode table)

Parameters

table SqlRecordSetNode

Table to truncate.

Returns

SqlTruncateNode

New SqlTruncateNode instance.

TypeCast(SqlExpressionNode, ISqlColumnTypeDefinition)

Creates a new SqlTypeCastExpressionNode instance.

[Pure]
public static SqlTypeCastExpressionNode TypeCast(SqlExpressionNode expression, ISqlColumnTypeDefinition typeDefinition)

Parameters

expression SqlExpressionNode

Underlying value to cast to a different type.

typeDefinition ISqlColumnTypeDefinition

ISqlColumnTypeDefinition instance that defines the target type.

Returns

SqlTypeCastExpressionNode

New SqlTypeCastExpressionNode instance.

TypeCast(SqlExpressionNode, Type)

Creates a new SqlTypeCastExpressionNode instance.

[Pure]
public static SqlTypeCastExpressionNode TypeCast(SqlExpressionNode expression, Type type)

Parameters

expression SqlExpressionNode

Underlying value to cast to a different type.

type Type

Target runtime type.

Returns

SqlTypeCastExpressionNode

New SqlTypeCastExpressionNode instance.

UnionAllWith(SqlQueryExpressionNode)

Creates a new SqlCompoundQueryComponentNode instance with UnionAll operator.

[Pure]
public static SqlCompoundQueryComponentNode UnionAllWith(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

Underlying query.

Returns

SqlCompoundQueryComponentNode

New SqlCompoundQueryComponentNode instance.

UnionWith(SqlQueryExpressionNode)

Creates a new SqlCompoundQueryComponentNode instance with Union operator.

[Pure]
public static SqlCompoundQueryComponentNode UnionWith(SqlQueryExpressionNode query)

Parameters

query SqlQueryExpressionNode

Underlying query.

Returns

SqlCompoundQueryComponentNode

New SqlCompoundQueryComponentNode instance.

Update(SqlDataSourceNode, params SqlValueAssignmentNode[])

Creates a new SqlUpdateNode instance.

[Pure]
public static SqlUpdateNode Update(SqlDataSourceNode dataSource, params SqlValueAssignmentNode[] assignments)

Parameters

dataSource SqlDataSourceNode

Data source that defines records to be updated.

assignments SqlValueAssignmentNode[]

Collection of value assignments that this update refers to.

Returns

SqlUpdateNode

New SqlUpdateNode instance.

Upsert(SqlQueryExpressionNode, SqlRecordSetNode, ReadOnlyArray<SqlDataFieldNode>, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>, ReadOnlyArray<SqlDataFieldNode>?)

Creates a new SqlUpsertNode instance.

[Pure]
public static SqlUpsertNode Upsert(SqlQueryExpressionNode query, SqlRecordSetNode recordSet, ReadOnlyArray<SqlDataFieldNode> insertDataFields, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>> updateAssignments, ReadOnlyArray<SqlDataFieldNode>? conflictTarget = null)

Parameters

query SqlQueryExpressionNode

SqlQueryExpressionNode 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.

Upsert(SqlValuesNode, SqlRecordSetNode, ReadOnlyArray<SqlDataFieldNode>, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>>, ReadOnlyArray<SqlDataFieldNode>?)

Creates a new SqlUpsertNode instance.

[Pure]
public static SqlUpsertNode Upsert(SqlValuesNode values, SqlRecordSetNode recordSet, ReadOnlyArray<SqlDataFieldNode> insertDataFields, Func<SqlRecordSetNode, SqlInternalRecordSetNode, IEnumerable<SqlValueAssignmentNode>> updateAssignments, ReadOnlyArray<SqlDataFieldNode>? conflictTarget = null)

Parameters

values 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.

Value(SqlConditionNode)

Creates a new SqlConditionValueNode instance.

[Pure]
public static SqlConditionValueNode Value(SqlConditionNode condition)

Parameters

condition SqlConditionNode

Underlying condition.

Returns

SqlConditionValueNode

New SqlConditionValueNode instance.

ValueAssignment(SqlDataFieldNode, SqlExpressionNode)

Creates a new SqlValueAssignmentNode instance.

[Pure]
public static SqlValueAssignmentNode ValueAssignment(SqlDataFieldNode dataField, SqlExpressionNode value)

Parameters

dataField SqlDataFieldNode

Data field to assign value to.

value SqlExpressionNode

Value to assign.

Returns

SqlValueAssignmentNode

New SqlValueAssignmentNode instance.

Values(SqlExpressionNode[,])

Creates a new SqlValuesNode instance from a 2-dimensional collection of values.

[Pure]
public static SqlValuesNode Values(SqlExpressionNode[,] expressions)

Parameters

expressions SqlExpressionNode[,]

2-dimensional collection of values.

Returns

SqlValuesNode

New SqlValuesNode instance.

Values(params SqlExpressionNode[])

Creates a new SqlValuesNode instance from a 1-dimensional collection of values.

[Pure]
public static SqlValuesNode Values(params SqlExpressionNode[] expressions)

Parameters

expressions SqlExpressionNode[]

1-dimensional collection of values.

Returns

SqlValuesNode

New SqlValuesNode instance.

View(ISqlViewBuilder, string?)

Creates a new SqlViewBuilderNode instance.

[Pure]
public static SqlViewBuilderNode View(ISqlViewBuilder value, string? alias = null)

Parameters

value ISqlViewBuilder

Underlying ISqlViewBuilder instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlViewBuilderNode

New SqlViewBuilderNode instance.

View(ISqlView, string?)

Creates a new SqlViewNode instance.

[Pure]
public static SqlViewNode View(ISqlView value, string? alias = null)

Parameters

value ISqlView

Underlying ISqlView instance.

alias string

Optional alias of this record set. Equal to null by default.

Returns

SqlViewNode

New SqlViewNode instance.

WindowDefinition(string, SqlExpressionNode[], SqlOrderByNode[], SqlWindowFrameNode?)

Creates a new SqlWindowDefinitionNode instance.

[Pure]
public static SqlWindowDefinitionNode WindowDefinition(string name, SqlExpressionNode[] partitioning, SqlOrderByNode[] ordering, SqlWindowFrameNode? frame = null)

Parameters

name string

Window's name.

partitioning SqlExpressionNode[]

Collection of expressions by which this window partitions the result set.

ordering SqlOrderByNode[]

Collection of ordering expressions used by this window.

frame SqlWindowFrameNode

Optional SqlWindowFrameNode instance that defines the frame of this window. Equal to null by default.

Returns

SqlWindowDefinitionNode

New SqlWindowDefinitionNode instance.

WindowDefinition(string, SqlOrderByNode[], SqlWindowFrameNode?)

Creates a new SqlWindowDefinitionNode instance.

[Pure]
public static SqlWindowDefinitionNode WindowDefinition(string name, SqlOrderByNode[] ordering, SqlWindowFrameNode? frame = null)

Parameters

name string

Window's name.

ordering SqlOrderByNode[]

Collection of ordering expressions used by this window.

frame SqlWindowFrameNode

Optional SqlWindowFrameNode instance that defines the frame of this window. Equal to null by default.

Returns

SqlWindowDefinitionNode

New SqlWindowDefinitionNode instance.

WindowDefinitionTrait(params SqlWindowDefinitionNode[])

Creates a new SqlWindowDefinitionTraitNode instance.

[Pure]
public static SqlWindowDefinitionTraitNode WindowDefinitionTrait(params SqlWindowDefinitionNode[] windows)

Parameters

windows SqlWindowDefinitionNode[]

Collection of window definitions.

Returns

SqlWindowDefinitionTraitNode

New SqlWindowDefinitionTraitNode instance.

WindowTrait(SqlWindowDefinitionNode)

Creates a new SqlWindowTraitNode instance.

[Pure]
public static SqlWindowTraitNode WindowTrait(SqlWindowDefinitionNode definition)

Parameters

definition SqlWindowDefinitionNode

Underlying window definition.

Returns

SqlWindowTraitNode

New SqlWindowTraitNode instance.