IDatabaseSchemaMethods
Namespace: MJCZone.DapperMatic.Interfaces
Assembly: MJCZone.DapperMatic
Summary
Provides database 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 (5)
Methods
GetSchemaQualifiedIdentifierName
Gets the schema-qualified identifier name.
string GetSchemaQualifiedIdentifierName(string schemaName, string tableName)Parameters
- schemaName (string) - The schema name.
- tableName (string) - The table name.
Returns
Type: string
The schema-qualified identifier name.
CreateSchemaIfNotExistsAsync
Creates the schema if it does not exist.
Task<bool> CreateSchemaIfNotExistsAsync(
IDbConnection db,
string schemaName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tx (IDbTransaction) - The 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.
DoesSchemaExistAsync
Checks if the schema exists.
Task<bool> DoesSchemaExistAsync(
IDbConnection db,
string schemaName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tx (IDbTransaction) - The 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.
GetSchemaNamesAsync
Gets the schema names.
Task<List<string>> GetSchemaNamesAsync(
IDbConnection db,
string schemaNameFilter,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaNameFilter (string) - The schema name filter.
- tx (IDbTransaction) - The 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 schema names.
DropSchemaIfExistsAsync
Drops the schema if it exists.
Task<bool> DropSchemaIfExistsAsync(
IDbConnection db,
string schemaName,
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tx (IDbTransaction) - The 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.