Table of Contents

Class SqlSchemaBuilder

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

Represents an SQL schema builder.

public abstract class SqlSchemaBuilder : SqlObjectBuilder, ISqlSchemaBuilder, ISqlObjectBuilder
Inheritance
SqlSchemaBuilder
Implements
Derived
Inherited Members

Constructors

SqlSchemaBuilder(SqlDatabaseBuilder, string, SqlObjectBuilderCollection)

Creates a new SqlSchemaBuilder instance.

protected SqlSchemaBuilder(SqlDatabaseBuilder database, string name, SqlObjectBuilderCollection objects)

Parameters

database SqlDatabaseBuilder

Database that this schema belongs to.

name string

Object's name.

objects SqlObjectBuilderCollection

Collection of objects that belong to this schema.

Properties

CanRemove

Specifies whether or not this object can be removed.

public override bool CanRemove { get; }

Property Value

bool

Objects

Collection of objects that belong to this schema.

public SqlObjectBuilderCollection Objects { get; }

Property Value

SqlObjectBuilderCollection

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.

QuickRemoveCore()

Performs a quick removal of this object.

protected override void QuickRemoveCore()

Remarks

See QuickRemove(SqlObjectBuilder) for more information.

Exceptions

NotSupportedException

Quick removal of schemas is not supported by default.

QuickRemoveObjects()

Quick-removes all Objects.

protected void QuickRemoveObjects()

ResetAllTableAndViewInfoCache()

Resets SqlRecordSetInfo of all tables and views.

protected void ResetAllTableAndViewInfoCache()

Remarks

SetName(string)

Changes the name of this object.

public SqlSchemaBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

SqlSchemaBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

ThrowIfDefault()

Throws an exception when this schema is the Default schema.

protected void ThrowIfDefault()

Exceptions

SqlObjectBuilderException

When this schema is the Default schema.