Table of Contents

Class SqlUpsertNode

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

Represents an SQL syntax tree statement node that defines an insertion of new records to a table or update of existing records in that table.

public sealed class SqlUpsertNode : SqlNodeBase, ISqlStatementNode
Inheritance
SqlUpsertNode
Implements
Inherited Members

Properties

ConflictTarget

Collection of data fields from the table that define the insertion conflict target.

public ReadOnlyArray<SqlDataFieldNode> ConflictTarget { get; }

Property Value

ReadOnlyArray<SqlDataFieldNode>

Remarks

Empty conflict target may cause the table's primary key to be used instead.

InsertDataFields

Collection of RecordSet data fields that the insertion part of this upsert refers to.

public ReadOnlyArray<SqlDataFieldNode> InsertDataFields { get; }

Property Value

ReadOnlyArray<SqlDataFieldNode>

RecordSet

Table to upsert into.

public SqlRecordSetNode RecordSet { get; }

Property Value

SqlRecordSetNode

Source

Source of records to be inserted or updated.

public SqlNodeBase Source { get; }

Property Value

SqlNodeBase

Remarks

This can either be an SqlValuesNode or an SqlQueryExpressionNode.

UpdateAssignments

Collection of value assignments that the update part of this upsert refers to.

public ReadOnlyArray<SqlValueAssignmentNode> UpdateAssignments { get; }

Property Value

ReadOnlyArray<SqlValueAssignmentNode>

UpdateSource

Source of records excluded from the insertion part of this upsert due to them already existing in the table.

public SqlInternalRecordSetNode UpdateSource { get; }

Property Value

SqlInternalRecordSetNode

Remarks

This record set can be used in the update part of an upsert statement.