Class MySqlIndexBuilder
Represents an SQL index constraint builder.
public sealed class MySqlIndexBuilder : SqlIndexBuilder, ISqlIndexBuilder, ISqlConstraintBuilder, ISqlObjectBuilder
- Inheritance
-
MySqlIndexBuilder
- Implements
- Inherited Members
- Extension Methods
Remarks
MySqlDialect implementation.
Properties
Columns
Collection of columns that define this index.
public SqlIndexBuilderColumns<MySqlColumnBuilder> Columns { get; }
Property Value
Database
Database that this object belongs to.
public MySqlDatabaseBuilder Database { get; }
Property Value
PrimaryKey
Optional ISqlPrimaryKeyBuilder instance attached to this index.
public MySqlPrimaryKeyBuilder? PrimaryKey { get; }
Property Value
ReferencedColumns
Collection of columns referenced by this index's Columns.
public SqlObjectBuilderArray<MySqlColumnBuilder> ReferencedColumns { get; }
Property Value
ReferencedFilterColumns
Collection of columns referenced by this index's Filter.
public SqlObjectBuilderArray<MySqlColumnBuilder> ReferencedFilterColumns { get; }
Property Value
Table
Table that this constraint is attached to.
public MySqlTableBuilder Table { get; }
Property Value
Methods
BeforeFilterChange(SqlConditionNode?)
Callback invoked just before Filter change is processed.
protected override SqlPropertyChange<SqlConditionNode?> BeforeFilterChange(SqlConditionNode? newValue)
Parameters
newValue
SqlConditionNodeValue to set.
Returns
- SqlPropertyChange<SqlConditionNode>
SqlPropertyChange<T> instance associated with Filter change attempt.
Exceptions
- SqlObjectBuilderException
When Filter of this index cannot be changed.
MarkAsUnique(bool)
Changes IsUnique value of this index.
public MySqlIndexBuilder MarkAsUnique(bool enabled = true)
Parameters
enabled
boolValue to set. Equal to true by default.
Returns
- MySqlIndexBuilder
this.
Exceptions
- SqlObjectBuilderException
When uniqueness cannot be changed.
MarkAsVirtual(bool)
Changes IsVirtual value of this index.
public MySqlIndexBuilder MarkAsVirtual(bool enabled = true)
Parameters
enabled
boolValue to set. Equal to true by default.
Returns
- MySqlIndexBuilder
this.
Exceptions
- SqlObjectBuilderException
When virtuality cannot be changed.
SetDefaultName()
Changes the name of this object to a default name.
public MySqlIndexBuilder SetDefaultName()
Returns
- MySqlIndexBuilder
this.
Remarks
See ISqlDefaultObjectNameProvider for more information.
Exceptions
- SqlObjectBuilderException
When name cannot be changed.
SetFilter(SqlConditionNode?)
Changes Filter value of this index.
public MySqlIndexBuilder SetFilter(SqlConditionNode? filter)
Parameters
filter
SqlConditionNodeValue to set.
Returns
- MySqlIndexBuilder
this.
Exceptions
- SqlObjectBuilderException
When filter cannot be changed.
SetName(string)
Changes the name of this object.
public MySqlIndexBuilder SetName(string name)
Parameters
name
stringName to set.
Returns
- MySqlIndexBuilder
this.
Exceptions
- SqlObjectBuilderException
When name cannot be changed.