Table of Contents

Class SqlCheckBuilder

Namespace
LfrlAnvil.Sql.Objects.Builders
Assembly
LfrlAnvil.Sql.Core.dll

Represents an SQL check constraint builder.

public abstract class SqlCheckBuilder : SqlConstraintBuilder, ISqlCheckBuilder, ISqlConstraintBuilder, ISqlObjectBuilder
Inheritance
SqlCheckBuilder
Implements
Derived
Inherited Members
Extension Methods

Constructors

SqlCheckBuilder(SqlTableBuilder, string, SqlConditionNode, ReadOnlyArray<SqlColumnBuilder>)

Creates a new SqlCheckBuilder instance.

protected SqlCheckBuilder(SqlTableBuilder table, string name, SqlConditionNode condition, ReadOnlyArray<SqlColumnBuilder> referencedColumns)

Parameters

table SqlTableBuilder

Table that this constraint is attached to.

name string

Object's name.

condition SqlConditionNode

Underlying condition of this check constraint.

referencedColumns ReadOnlyArray<SqlColumnBuilder>

Collection of columns referenced by this check constraint.

Properties

Condition

Underlying condition of this check constraint.

public SqlConditionNode Condition { get; }

Property Value

SqlConditionNode

ReferencedColumns

Collection of columns referenced by this check constraint.

public SqlObjectBuilderArray<SqlColumnBuilder> ReferencedColumns { get; }

Property Value

SqlObjectBuilderArray<SqlColumnBuilder>

Methods

BeforeRemove()

Callback invoked just before the removal is processed.

protected override void BeforeRemove()

Exceptions

SqlObjectBuilderException

When this object cannot be removed.

ClearReferencedColumns()

Removes all columns from ReferencedColumns and removes this check constraint from their reference sources.

protected void ClearReferencedColumns()

GetDefaultName()

Creates a default name for this constraint.

[Pure]
protected override sealed string GetDefaultName()

Returns

string

Default name for this constraint.

QuickRemoveCore()

Performs a quick removal of this object.

protected override void QuickRemoveCore()

Remarks

See QuickRemove(SqlObjectBuilder) for more information.

SetDefaultName()

Changes the name of this object to a default name.

public SqlCheckBuilder SetDefaultName()

Returns

SqlCheckBuilder

this.

Remarks

See ISqlDefaultObjectNameProvider for more information.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetName(string)

Changes the name of this object.

public SqlCheckBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

SqlCheckBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetReferencedColumns(ReadOnlyArray<SqlColumnBuilder>)

Adds a collection of columns to ReferencedColumns and adds this check constraint to their reference sources.

protected void SetReferencedColumns(ReadOnlyArray<SqlColumnBuilder> columns)

Parameters

columns ReadOnlyArray<SqlColumnBuilder>

Collection of columns to add.