IDatabaseIndexMethods
Namespace: MJCZone.DapperMatic.Interfaces
Assembly: MJCZone.DapperMatic
Summary
Provides database index methods for database operations.
abstract public
Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.
Contents
Methods (11)
Methods
| Method | Summary |
|---|---|
| CreateIndexIfNotExistsAsync | Creates an index if it does not already exist. |
| CreateIndexIfNotExistsAsync | Creates an index if it does not already exist. |
| DoesIndexExistOnColumnAsync | Checks if an index exists on a specific column. |
| DoesIndexExistAsync | Checks if an index exists. |
| GetIndexesOnColumnAsync | Gets the indexes on a specific column. |
| GetIndexAsync | Gets a specific index. |
| GetIndexesAsync | Gets the indexes. |
| GetIndexNamesOnColumnAsync | Gets the index names on a specific column. |
| GetIndexNamesAsync | Gets the index names. |
| DropIndexesOnColumnIfExistsAsync | Drops the indexes on a specific column if they exist. |
| DropIndexIfExistsAsync | Drops an index if it exists. |
CreateIndexIfNotExistsAsync
Creates an index if it does not already exist.
Task<bool> CreateIndexIfNotExistsAsync(
IDbConnection db,
DmIndex index,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- index (DmIndex) - The index.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating success.
CreateIndexIfNotExistsAsync
Creates an index if it does not already exist.
Task<bool> CreateIndexIfNotExistsAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexName,
DmOrderedColumn[] columns,
bool isUnique,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexName (string) - The index name.
- columns (DmOrderedColumn[]) - The columns to be indexed.
- isUnique (bool) - Indicates whether the index is unique.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating success.
DoesIndexExistOnColumnAsync
Checks if an index exists on a specific column.
Task<bool> DoesIndexExistOnColumnAsync(
IDbConnection db,
string schemaName,
string tableName,
string columnName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- columnName (string) - The column name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating existence.
DoesIndexExistAsync
Checks if an index exists.
Task<bool> DoesIndexExistAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexName (string) - The index name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating existence.
GetIndexesOnColumnAsync
Gets the indexes on a specific column.
Task<List<DmIndex>> GetIndexesOnColumnAsync(
IDbConnection db,
string schemaName,
string tableName,
string columnName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- columnName (string) - The column name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<List<DmIndex>>
A task that represents the asynchronous operation. The task result contains a list of indexes.
GetIndexAsync
Gets a specific index.
Task<DmIndex?> GetIndexAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexName (string) - The index name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<DmIndex?>
A task that represents the asynchronous operation. The task result contains the index.
GetIndexesAsync
Gets the indexes.
Task<List<DmIndex>> GetIndexesAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexNameFilter,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexNameFilter (string) - The index name filter.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<List<DmIndex>>
A task that represents the asynchronous operation. The task result contains a list of indexes.
GetIndexNamesOnColumnAsync
Gets the index names on a specific column.
Task<List<string>> GetIndexNamesOnColumnAsync(
IDbConnection db,
string schemaName,
string tableName,
string columnName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- columnName (string) - The column name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<List<string>>
A task that represents the asynchronous operation. The task result contains a list of index names.
GetIndexNamesAsync
Gets the index names.
Task<List<string>> GetIndexNamesAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexNameFilter,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexNameFilter (string) - The index name filter.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<List<string>>
A task that represents the asynchronous operation. The task result contains a list of index names.
DropIndexesOnColumnIfExistsAsync
Drops the indexes on a specific column if they exist.
Task<bool> DropIndexesOnColumnIfExistsAsync(
IDbConnection db,
string schemaName,
string tableName,
string columnName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- columnName (string) - The column name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating success.
DropIndexIfExistsAsync
Drops an index if it exists.
Task<bool> DropIndexIfExistsAsync(
IDbConnection db,
string schemaName,
string tableName,
string indexName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexName (string) - The index name.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating success.