Class TableIndex
Holds information for index definitions against sql tables
Inherited Members
Namespace: LemonEdge.Utils.Database
Assembly: LemonEdge.Utils.dll
Syntax
public sealed class TableIndex : ICloneable<TableIndex>, ICloneable
Constructors
TableIndex()
Declaration
public TableIndex()
Fields
CANVAS
Declaration
public const string CANVAS = "CanvasItem"
Field Value
Type | Description |
---|---|
string |
UNIQUE
Declaration
public const string UNIQUE = "UniqueItem"
Field Value
Type | Description |
---|---|
string |
Properties
IncludeColumnNames
A list of columns to be included in the index
Declaration
public string[] IncludeColumnNames { get; set; }
Property Value
Type | Description |
---|---|
string[] |
IsClustered
Indicates if the index is a clustered index.
Only one index against a table can be clustered. LemonEdge automatically creates the appropriate clustered index for your tables.
Declaration
public bool IsClustered { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsUnique
Indicates that this index points to unique row entries
Declaration
public bool IsUnique { get; set; }
Property Value
Type | Description |
---|---|
bool |
ItemColumnNames
A list of the column names in the index
Declaration
public string[] ItemColumnNames { get; set; }
Property Value
Type | Description |
---|---|
string[] |
ItemOrders
A list of the order for each ItemColumnNames
Declaration
public Order[] ItemOrders { get; set; }
Property Value
Type | Description |
---|---|
Order[] |
Name
The name of the index
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
NameWithPrefix
The name of the index prefixed with either cl_ or ix_
Declaration
public string NameWithPrefix { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Clone()
Creates a new instance of this class (of type TableIndex) with all the same property values as this instance
Declaration
public TableIndex Clone()
Returns
Type | Description |
---|---|
TableIndex | A new instance of this class with all the same property values as this instance |
CopyFromSource(TableIndex)
Updates all properties in this item to have the same properties as the source object.
Declaration
public void CopyFromSource(TableIndex source)
Parameters
Type | Name | Description |
---|---|---|
TableIndex | source | The source object to copy all values from. |
CopyFromSource(object)
Updates all properties in this item to have the same properties as the source object.
The source object should be of the same type as this one
Declaration
public void CopyFromSource(object source)
Parameters
Type | Name | Description |
---|---|---|
object | source | The source object to copy all values from. Should be of the same type as this one. |
InsertColIndex(string, Order)
Adds the specified column and roder to this index
Declaration
public void InsertColIndex(string column, Order order)
Parameters
Type | Name | Description |
---|---|---|
string | column | The column to add to the index |
Order | order | The order to use for this column in the index |
InsertColIndex(string, Order, string)
Adds the specified column and order to this index before the specified beforeColumn
Declaration
public void InsertColIndex(string column, Order order, string beforeColumn)
Parameters
Type | Name | Description |
---|---|---|
string | column | The column to add to the index |
Order | order | The order to use for this column in the index |
string | beforeColumn | The column to add this column index before |
InsertColIndex(string, string)
Adds the specified column before the specified beforeColumn
using the same order as that
column, to this index
Declaration
public void InsertColIndex(string column, string beforeColumn)
Parameters
Type | Name | Description |
---|---|---|
string | column | The column to add to the index |
string | beforeColumn | The column to add this column index before |
ToSQL(string)
Declaration
public string ToSQL(string tableName)
Parameters
Type | Name | Description |
---|---|---|
string | tableName |
Returns
Type | Description |
---|---|
string |