Table of Contents

Interface ISqlIndexBuilder

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

Represents an SQL index constraint builder.

public interface ISqlIndexBuilder : ISqlConstraintBuilder, ISqlObjectBuilder
Inherited Members
Extension Methods

Properties

Columns

Collection of columns that define this index.

SqlIndexBuilderColumns<ISqlColumnBuilder> Columns { get; }

Property Value

SqlIndexBuilderColumns<ISqlColumnBuilder>

Filter

Specifies an optional filter condition of this index.

SqlConditionNode? Filter { get; }

Property Value

SqlConditionNode

IsUnique

Specifies whether or not this index is unique.

bool IsUnique { get; }

Property Value

bool

IsVirtual

Specifies whether or not this index is virtual.

bool IsVirtual { get; }

Property Value

bool

Remarks

Virtual indexes aren't actually created in the database.

PrimaryKey

Optional ISqlPrimaryKeyBuilder instance attached to this index.

ISqlPrimaryKeyBuilder? PrimaryKey { get; }

Property Value

ISqlPrimaryKeyBuilder

ReferencedColumns

Collection of columns referenced by this index's Columns.

IReadOnlyCollection<ISqlColumnBuilder> ReferencedColumns { get; }

Property Value

IReadOnlyCollection<ISqlColumnBuilder>

ReferencedFilterColumns

Collection of columns referenced by this index's Filter.

IReadOnlyCollection<ISqlColumnBuilder> ReferencedFilterColumns { get; }

Property Value

IReadOnlyCollection<ISqlColumnBuilder>

Methods

MarkAsUnique(bool)

Changes IsUnique value of this index.

ISqlIndexBuilder MarkAsUnique(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

ISqlIndexBuilder

this.

Exceptions

SqlObjectBuilderException

When uniqueness cannot be changed.

MarkAsVirtual(bool)

Changes IsVirtual value of this index.

ISqlIndexBuilder MarkAsVirtual(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

ISqlIndexBuilder

this.

Exceptions

SqlObjectBuilderException

When virtuality cannot be changed.

SetDefaultName()

Changes the name of this object to a default name.

ISqlIndexBuilder SetDefaultName()

Returns

ISqlIndexBuilder

this.

Remarks

See ISqlDefaultObjectNameProvider for more information.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetFilter(SqlConditionNode?)

Changes Filter value of this index.

ISqlIndexBuilder SetFilter(SqlConditionNode? filter)

Parameters

filter SqlConditionNode

Value to set.

Returns

ISqlIndexBuilder

this.

Exceptions

SqlObjectBuilderException

When filter cannot be changed.

SetName(string)

Changes the name of this object.

ISqlIndexBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

ISqlIndexBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.