Interface ISqlIndexBuilder
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
Filter
Specifies an optional filter condition of this index.
SqlConditionNode? Filter { get; }
Property Value
IsUnique
Specifies whether or not this index is unique.
bool IsUnique { get; }
Property Value
IsVirtual
Specifies whether or not this index is virtual.
bool IsVirtual { get; }
Property Value
Remarks
Virtual indexes aren't actually created in the database.
PrimaryKey
Optional ISqlPrimaryKeyBuilder instance attached to this index.
ISqlPrimaryKeyBuilder? PrimaryKey { get; }
Property Value
ReferencedColumns
Collection of columns referenced by this index's Columns.
IReadOnlyCollection<ISqlColumnBuilder> ReferencedColumns { get; }
Property Value
ReferencedFilterColumns
Collection of columns referenced by this index's Filter.
IReadOnlyCollection<ISqlColumnBuilder> ReferencedFilterColumns { get; }
Property Value
Methods
MarkAsUnique(bool)
Changes IsUnique value of this index.
ISqlIndexBuilder MarkAsUnique(bool enabled = true)
Parameters
enabled
boolValue 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
boolValue 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
SqlConditionNodeValue 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
stringName to set.
Returns
- ISqlIndexBuilder
this.
Exceptions
- SqlObjectBuilderException
When name cannot be changed.