Table of Contents

Class SqlTableBuilder

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

Represents an SQL table builder.

public abstract class SqlTableBuilder : SqlObjectBuilder, ISqlTableBuilder, ISqlObjectBuilder
Inheritance
SqlTableBuilder
Implements
Derived
Inherited Members
Extension Methods

Constructors

SqlTableBuilder(SqlSchemaBuilder, string, SqlColumnBuilderCollection, SqlConstraintBuilderCollection)

Creates a new SqlTableBuilder instance.

protected SqlTableBuilder(SqlSchemaBuilder schema, string name, SqlColumnBuilderCollection columns, SqlConstraintBuilderCollection constraints)

Parameters

schema SqlSchemaBuilder

Schema that this table belongs to.

name string

Object's name.

columns SqlColumnBuilderCollection

Collection of columns that belong to this table.

constraints SqlConstraintBuilderCollection

Collection of constraints that belong to this table.

Properties

Columns

Collection of columns that belong to this table.

public SqlColumnBuilderCollection Columns { get; }

Property Value

SqlColumnBuilderCollection

Constraints

Collection of constraints that belong to this table.

public SqlConstraintBuilderCollection Constraints { get; }

Property Value

SqlConstraintBuilderCollection

Info

Represents a full name information of this table.

public SqlRecordSetInfo Info { get; }

Property Value

SqlRecordSetInfo

Node

Underlying SqlTableBuilderNode instance that represents this table.

public SqlTableBuilderNode Node { get; }

Property Value

SqlTableBuilderNode

Schema

Schema that this table belongs to.

public SqlSchemaBuilder Schema { get; }

Property Value

SqlSchemaBuilder

Methods

AfterNameChange(string)

Callback invoked just after Name change has been processed.

protected override void AfterNameChange(string originalValue)

Parameters

originalValue string

Original value.

AfterRemove()

Callback invoked just after the removal has been processed.

protected override void AfterRemove()

BeforeNameChange(string)

Callback invoked just before Name change is processed.

protected override SqlPropertyChange<string> BeforeNameChange(string newValue)

Parameters

newValue string

Value to set.

Returns

SqlPropertyChange<string>

SqlPropertyChange<T> instance associated with Name change attempt.

Exceptions

SqlObjectBuilderException

When Name of this object cannot be changed.

BeforeRemove()

Callback invoked just before the removal is processed.

protected override void BeforeRemove()

Exceptions

SqlObjectBuilderException

When this object cannot be removed.

QuickRemoveColumns()

Removes all Columns from this table. This is a version for the QuickRemoveCore() method.

protected void QuickRemoveColumns()

QuickRemoveConstraints()

Removes all Constraints from this table. This is a version for the QuickRemoveCore() method.

protected void QuickRemoveConstraints()

QuickRemoveCore()

Performs a quick removal of this object.

protected override void QuickRemoveCore()

Remarks

See QuickRemove(SqlObjectBuilder) for more information.

SetName(string)

Changes the name of this object.

public SqlTableBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

SqlTableBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

ToString()

Returns a string representation of this SqlTableBuilder instance.

[Pure]
public override string ToString()

Returns

string

String representation.