Skip to content

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.

csharp
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.

csharp
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.

csharp
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.

csharp
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.

csharp
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.