Skip to content

DbConnectionExtensions

Namespace: MJCZone.DapperMatic

Assembly: MJCZone.DapperMatic

Summary

Extension methods for IDbConnection.

static public

Contents

Methods (195)

Methods

MethodSummary
DoesCheckConstraintExistAsyncChecks if a check constraint exists in the specified table.
DoesCheckConstraintExistAsyncChecks if a check constraint exists in the specified table.
DoesCheckConstraintExistOnColumnAsyncChecks if a check constraint exists on the specified column.
DoesCheckConstraintExistOnColumnAsyncChecks if a check constraint exists on the specified column.
CreateCheckConstraintIfNotExistsAsyncCreates a check constraint if it does not exist.
CreateCheckConstraintIfNotExistsAsyncCreates a check constraint if it does not exist.
CreateCheckConstraintIfNotExistsAsyncCreates a check constraint if it does not exist.
GetCheckConstraintAsyncGets the check constraint with the specified name.
GetCheckConstraintAsyncGets the check constraint with the specified name.
GetCheckConstraintNameOnColumnAsyncGets the name of the check constraint on the specified column.
GetCheckConstraintNameOnColumnAsyncGets the name of the check constraint on the specified column.
GetCheckConstraintNamesAsyncGets the names of the check constraints in the specified table.
GetCheckConstraintNamesAsyncGets the names of the check constraints in the specified table.
GetCheckConstraintOnColumnAsyncGets the check constraint on the specified column.
GetCheckConstraintOnColumnAsyncGets the check constraint on the specified column.
GetCheckConstraintsAsyncGets the check constraints in the specified table.
GetCheckConstraintsAsyncGets the check constraints in the specified table.
DropCheckConstraintIfExistsAsyncDrops the check constraint if it exists.
DropCheckConstraintIfExistsAsyncDrops the check constraint if it exists.
DropCheckConstraintOnColumnIfExistsAsyncDrops the check constraint on the specified column if it exists.
DropCheckConstraintOnColumnIfExistsAsyncDrops the check constraint on the specified column if it exists.
DoesColumnExistAsyncChecks if a column exists in the specified table.
DoesColumnExistAsyncChecks if a column exists in the specified table.
DoesColumnExistAsyncChecks if a column exists in the specified table.
GetColumnAsyncGets the details of a column in the specified table.
GetColumnAsyncGets the details of a column in the specified table.
GetColumnAsyncGets the details of a column in the specified table.
GetColumnNamesAsyncGets the names of columns in the specified table.
GetColumnNamesAsyncGets the names of columns in the specified table.
GetColumnsAsyncGets the details of columns in the specified table.
GetColumnsAsyncGets the details of columns in the specified table.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
CreateColumnIfNotExistsAsyncCreates a column if it does not exist.
DropColumnIfExistsAsyncDrops a column if it exists.
DropColumnIfExistsAsyncDrops a column if it exists.
RenameColumnIfExistsAsyncRenames a column if it exists.
RenameColumnIfExistsAsyncRenames a column if it exists.
RenameColumnIfExistsAsyncRenames a column if it exists.
GetDbProviderTypeGets the DbProviderType of the database connection.
GetDatabaseVersionAsyncGets the version of the database.
GetProviderTypeMapGets the IDbProviderTypeMap of the database connection....
GetDotnetTypeFromSqlTypeGets the .NET type descriptor from the SQL type.
GetSqlTypeFromDotnetTypeGets the SQL type from the .NET type descriptor.
DoesDefaultConstraintExistAsyncChecks if a default constraint exists.
DoesDefaultConstraintExistAsyncChecks if a default constraint exists.
DoesDefaultConstraintExistOnColumnAsyncChecks if a default constraint exists on a column.
DoesDefaultConstraintExistOnColumnAsyncChecks if a default constraint exists on a column.
DoesDefaultConstraintExistOnColumnAsyncChecks if a default constraint exists on a column.
CreateDefaultConstraintIfNotExistsAsyncCreates a default constraint if it does not exist.
CreateDefaultConstraintIfNotExistsAsyncCreates a default constraint if it does not exist.
CreateDefaultConstraintIfNotExistsAsyncCreates a default constraint if it does not exist.
CreateDefaultConstraintIfNotExistsAsyncCreates a default constraint if it does not exist.
GetDefaultConstraintAsyncGets a default constraint.
GetDefaultConstraintAsyncGets a default constraint.
GetDefaultConstraintNameOnColumnAsyncGets the name of the default constraint on a column.
GetDefaultConstraintNameOnColumnAsyncGets the name of the default constraint on a column.
GetDefaultConstraintNameOnColumnAsyncGets the name of the default constraint on a column.
GetDefaultConstraintNamesAsyncGets the names of default constraints.
GetDefaultConstraintNamesAsyncGets the names of default constraints.
GetDefaultConstraintOnColumnAsyncGets the default constraint on a column.
GetDefaultConstraintOnColumnAsyncGets the default constraint on a column.
GetDefaultConstraintOnColumnAsyncGets the default constraint on a column.
GetDefaultConstraintsAsyncGets the default constraints.
GetDefaultConstraintsAsyncGets the default constraints.
DropDefaultConstraintIfExistsAsyncDrops a default constraint if it exists.
DropDefaultConstraintIfExistsAsyncDrops a default constraint if it exists.
DropDefaultConstraintOnColumnIfExistsAsyncDrops a default constraint on a column if it exists.
DropDefaultConstraintOnColumnIfExistsAsyncDrops a default constraint on a column if it exists.
DropDefaultConstraintOnColumnIfExistsAsyncDrops a default constraint on a column if it exists.
DoesForeignKeyConstraintExistOnColumnAsyncChecks if a foreign key constraint exists on a specific column.
DoesForeignKeyConstraintExistOnColumnAsyncChecks if a foreign key constraint exists on a specific column.
DoesForeignKeyConstraintExistOnColumnAsyncChecks if a foreign key constraint exists on a specific column.
DoesForeignKeyConstraintExistAsyncChecks if a foreign key constraint exists.
DoesForeignKeyConstraintExistAsyncChecks if a foreign key constraint exists.
CreateForeignKeyConstraintIfNotExistsAsyncCreates a foreign key constraint if it does not exist.
CreateForeignKeyConstraintIfNotExistsAsyncCreates a foreign key constraint if it does not exist.
CreateForeignKeyConstraintIfNotExistsAsyncCreates a foreign key constraint if it does not exist.
GetForeignKeyConstraintOnColumnAsyncGets the foreign key constraint on a specific column.
GetForeignKeyConstraintOnColumnAsyncGets the foreign key constraint on a specific column.
GetForeignKeyConstraintOnColumnAsyncGets the foreign key constraint on a specific column.
GetForeignKeyConstraintAsyncGets the foreign key constraint.
GetForeignKeyConstraintAsyncGets the foreign key constraint.
GetForeignKeyConstraintsAsyncGets the foreign key constraints.
GetForeignKeyConstraintsAsyncGets the foreign key constraints.
GetForeignKeyConstraintNameOnColumnAsyncGets the foreign key constraint name on a specific column.
GetForeignKeyConstraintNameOnColumnAsyncGets the foreign key constraint name on a specific column.
GetForeignKeyConstraintNameOnColumnAsyncGets the foreign key constraint name on a specific column.
GetForeignKeyConstraintNamesAsyncGets the foreign key constraint names.
GetForeignKeyConstraintNamesAsyncGets the foreign key constraint names.
DropForeignKeyConstraintOnColumnIfExistsAsyncDrops the foreign key constraint on a specific column if it exists.
DropForeignKeyConstraintOnColumnIfExistsAsyncDrops the foreign key constraint on a specific column if it exists.
DropForeignKeyConstraintOnColumnIfExistsAsyncDrops the foreign key constraint on a specific column if it exists.
DropForeignKeyConstraintIfExistsAsyncDrops the foreign key constraint if it exists.
DropForeignKeyConstraintIfExistsAsyncDrops the foreign key constraint if it exists.
DoesIndexExistOnColumnAsyncChecks if an index exists on a specified column.
DoesIndexExistOnColumnAsyncChecks if an index exists on a specified column.
DoesIndexExistOnColumnAsyncChecks if an index exists on a specified column.
DoesIndexExistAsyncChecks if an index exists.
DoesIndexExistAsyncChecks if an index exists.
CreateIndexIfNotExistsAsyncCreates an index if it does not exist.
CreateIndexIfNotExistsAsyncCreates an index if it does not exist.
CreateIndexIfNotExistsAsyncCreates an index if it does not exist.
GetIndexesOnColumnAsyncGets the indexes on a specified column.
GetIndexesOnColumnAsyncGets the indexes on a specified column.
GetIndexesOnColumnAsyncGets the indexes on a specified column.
GetIndexAsyncGets a specified index.
GetIndexAsyncGets a specified index.
GetIndexesAsyncGets the indexes on a specified table.
GetIndexesAsyncGets the indexes on a specified table.
GetIndexNamesOnColumnAsyncGets the names of indexes on a specified column.
GetIndexNamesOnColumnAsyncGets the names of indexes on a specified column.
GetIndexNamesOnColumnAsyncGets the names of indexes on a specified column.
GetIndexNamesAsyncGets the names of indexes on a specified table.
GetIndexNamesAsyncGets the names of indexes on a specified table.
DropIndexesOnColumnIfExistsAsyncDrops indexes on a specified column if they exist.
DropIndexesOnColumnIfExistsAsyncDrops indexes on a specified column if they exist.
DropIndexesOnColumnIfExistsAsyncDrops indexes on a specified column if they exist.
DropIndexIfExistsAsyncDrops a specified index if it exists.
DropIndexIfExistsAsyncDrops a specified index if it exists.
DoesPrimaryKeyConstraintExistAsyncChecks if a primary key constraint exists in the specified table.
DoesPrimaryKeyConstraintExistAsyncChecks if a primary key constraint exists in the specified table.
CreatePrimaryKeyConstraintIfNotExistsAsyncCreates a primary key constraint if it does not exist.
CreatePrimaryKeyConstraintIfNotExistsAsyncCreates a primary key constraint if it does not exist.
CreatePrimaryKeyConstraintIfNotExistsAsyncCreates a primary key constraint if it does not exist.
GetPrimaryKeyConstraintAsyncGets the primary key constraint for the specified table.
GetPrimaryKeyConstraintAsyncGets the primary key constraint for the specified table.
DropPrimaryKeyConstraintIfExistsAsyncDrops the primary key constraint if it exists.
DropPrimaryKeyConstraintIfExistsAsyncDrops the primary key constraint if it exists.
SupportsSchemasDetermines whether the database supports schemas.
GetSchemaQualifiedTableNameGets the schema-qualified table name.
SupportsCheckConstraintsAsyncDetermines whether the database supports check constraints asynchronously.
SupportsOrderedKeysInConstraintsAsyncDetermines whether the database supports ordered keys in constraints asynchronously.
CreateSchemaIfNotExistsAsyncCreates the schema if it does not exist asynchronously.
DoesSchemaExistAsyncDetermines whether the schema exists asynchronously.
GetSchemaNamesAsyncGets the schema names asynchronously.
DropSchemaIfExistsAsyncDrops the schema if it exists asynchronously.
DoesTableExistAsyncChecks if a table exists in the database.
DoesTableExistAsyncChecks if a table exists in the database.
CreateTablesIfNotExistsAsyncCreates tables if they do not exist.
CreateTablesIfNotExistsAsyncCreates tables if they do not exist.
CreateTableIfNotExistsAsyncCreates a table if it does not exist.
CreateTableIfNotExistsAsyncCreates a table if it does not exist.
CreateTableIfNotExistsAsyncCreates a table if it does not exist.
GetTableAsyncGets the table definition.
GetTableAsyncGets the table definition.
GetTablesAsyncGets the list of table definitions.
GetTableNamesAsyncGets the list of table names.
DropTableIfExistsAsyncDrops a table if it exists.
DropTableIfExistsAsyncDrops a table if it exists.
RenameTableIfExistsAsyncRenames a table if it exists.
RenameTableIfExistsAsyncRenames a table if it exists.
TruncateTableIfExistsAsyncTruncates a table if it exists.
TruncateTableIfExistsAsyncTruncates a table if it exists.
DoesUniqueConstraintExistOnColumnAsyncChecks if a unique constraint exists on a specified column.
DoesUniqueConstraintExistOnColumnAsyncChecks if a unique constraint exists on a specified column.
DoesUniqueConstraintExistOnColumnAsyncChecks if a unique constraint exists on a specified column.
DoesUniqueConstraintExistAsyncChecks if a unique constraint exists.
DoesUniqueConstraintExistAsyncChecks if a unique constraint exists.
CreateUniqueConstraintIfNotExistsAsyncCreates a unique constraint if it does not exist.
CreateUniqueConstraintIfNotExistsAsyncCreates a unique constraint if it does not exist.
CreateUniqueConstraintIfNotExistsAsyncCreates a unique constraint if it does not exist.
GetUniqueConstraintOnColumnAsyncGets the unique constraint on a specified column.
GetUniqueConstraintOnColumnAsyncGets the unique constraint on a specified column.
GetUniqueConstraintOnColumnAsyncGets the unique constraint on a specified column.
GetUniqueConstraintAsyncGets the unique constraint.
GetUniqueConstraintAsyncGets the unique constraint.
GetUniqueConstraintsAsyncGets the unique constraints.
GetUniqueConstraintsAsyncGets the unique constraints.
GetUniqueConstraintNameOnColumnAsyncGets the unique constraint name on a specified column.
GetUniqueConstraintNameOnColumnAsyncGets the unique constraint name on a specified column.
GetUniqueConstraintNameOnColumnAsyncGets the unique constraint name on a specified column.
GetUniqueConstraintNamesAsyncGets the unique constraint names.
GetUniqueConstraintNamesAsyncGets the unique constraint names.
DropUniqueConstraintOnColumnIfExistsAsyncDrops the unique constraint on a specified column if it exists.
DropUniqueConstraintOnColumnIfExistsAsyncDrops the unique constraint on a specified column if it exists.
DropUniqueConstraintOnColumnIfExistsAsyncDrops the unique constraint on a specified column if it exists.
DropUniqueConstraintIfExistsAsyncDrops the unique constraint if it exists.
DropUniqueConstraintIfExistsAsyncDrops the unique constraint if it exists.
DoesViewExistAsyncChecks if a view exists in the database.
CreateViewIfNotExistsAsyncCreates a view if it does not exist.
CreateViewIfNotExistsAsyncCreates a view if it does not exist.
UpdateViewIfExistsAsyncUpdates a view if it exists.
GetViewAsyncGets a view from the database.
GetViewsAsyncGets a list of views from the database.
GetViewNamesAsyncGets a list of view names from the database.
DropViewIfExistsAsyncDrops a view if it exists.
RenameViewIfExistsAsyncRenames a view if it exists.
GetType
ToString
Equals
GetHashCode

DoesCheckConstraintExistAsync

Checks if a check constraint exists in the specified table.

csharp
Task<bool> DoesCheckConstraintExistAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint exists, otherwise false.

DoesCheckConstraintExistAsync

Checks if a check constraint exists in the specified table.

csharp
Task<bool> DoesCheckConstraintExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint exists, otherwise false.

DoesCheckConstraintExistOnColumnAsync

Checks if a check constraint exists on the specified column.

csharp
Task<bool> DoesCheckConstraintExistOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint exists, otherwise false.

DoesCheckConstraintExistOnColumnAsync

Checks if a check constraint exists on the specified column.

csharp
Task<bool> DoesCheckConstraintExistOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint exists, otherwise false.

CreateCheckConstraintIfNotExistsAsync

Creates a check constraint if it does not exist.

csharp
Task<bool> CreateCheckConstraintIfNotExistsAsync(
    IDbConnection db,
    DmCheckConstraint constraint,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraint (DmCheckConstraint) - The check constraint.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint was created, otherwise false.

CreateCheckConstraintIfNotExistsAsync

Creates a check constraint if it does not exist.

csharp
Task<bool> CreateCheckConstraintIfNotExistsAsync(
    IDbConnection db,
    string columnName,
    string constraintName,
    string expression,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • constraintName (string) - The constraint name.
  • expression (string) - The constraint expression.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint was created, otherwise false.

CreateCheckConstraintIfNotExistsAsync

Creates a check constraint if it does not exist.

csharp
Task<bool> CreateCheckConstraintIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnName,
    string constraintName,
    string expression,
    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.
  • constraintName (string) - The constraint name.
  • expression (string) - The constraint expression.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<bool>

True if the constraint was created, otherwise false.

GetCheckConstraintAsync

Gets the check constraint with the specified name.

csharp
Task<DmCheckConstraint?> GetCheckConstraintAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmCheckConstraint?>

The check constraint, or null if not found.

GetCheckConstraintAsync

Gets the check constraint with the specified name.

csharp
Task&lt;DmCheckConstraint?&gt; GetCheckConstraintAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmCheckConstraint?>

The check constraint, or null if not found.

GetCheckConstraintNameOnColumnAsync

Gets the name of the check constraint on the specified column.

csharp
Task&lt;string?&gt; GetCheckConstraintNameOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The name of the check constraint, or null if not found.

GetCheckConstraintNameOnColumnAsync

Gets the name of the check constraint on the specified column.

csharp
Task&lt;string?&gt; GetCheckConstraintNameOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The name of the check constraint, or null if not found.

GetCheckConstraintNamesAsync

Gets the names of the check constraints in the specified table.

csharp
Task&lt;List&lt;string&gt;&gt; GetCheckConstraintNamesAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of check constraint names.

GetCheckConstraintNamesAsync

Gets the names of the check constraints in the specified table.

csharp
Task&lt;List&lt;string&gt;&gt; GetCheckConstraintNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of check constraint names.

GetCheckConstraintOnColumnAsync

Gets the check constraint on the specified column.

csharp
Task&lt;DmCheckConstraint?&gt; GetCheckConstraintOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmCheckConstraint?>

The check constraint, or null if not found.

GetCheckConstraintOnColumnAsync

Gets the check constraint on the specified column.

csharp
Task&lt;DmCheckConstraint?&gt; GetCheckConstraintOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmCheckConstraint?>

The check constraint, or null if not found.

GetCheckConstraintsAsync

Gets the check constraints in the specified table.

csharp
Task&lt;List&lt;DmCheckConstraint&gt;&gt; GetCheckConstraintsAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmCheckConstraint>>

A list of check constraints.

GetCheckConstraintsAsync

Gets the check constraints in the specified table.

csharp
Task&lt;List&lt;DmCheckConstraint&gt;&gt; GetCheckConstraintsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmCheckConstraint>>

A list of check constraints.

DropCheckConstraintIfExistsAsync

Drops the check constraint if it exists.

csharp
Task&lt;bool&gt; DropCheckConstraintIfExistsAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropCheckConstraintIfExistsAsync

Drops the check constraint if it exists.

csharp
Task&lt;bool&gt; DropCheckConstraintIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropCheckConstraintOnColumnIfExistsAsync

Drops the check constraint on the specified column if it exists.

csharp
Task&lt;bool&gt; DropCheckConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropCheckConstraintOnColumnIfExistsAsync

Drops the check constraint on the specified column if it exists.

csharp
Task&lt;bool&gt; DropCheckConstraintOnColumnIfExistsAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DoesColumnExistAsync

Checks if a column exists in the specified table.

csharp
Task&lt;bool&gt; DoesColumnExistAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column exists, otherwise false.

DoesColumnExistAsync

Checks if a column exists in the specified table.

csharp
Task&lt;bool&gt; DoesColumnExistAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • tx (Object}}) - The transaction to use, or null.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column exists, otherwise false.

DoesColumnExistAsync

Checks if a column exists in the specified table.

csharp
Task&lt;bool&gt; DoesColumnExistAsync(
    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 transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column exists, otherwise false.

GetColumnAsync

Gets the details of a column in the specified table.

csharp
Task&lt;DmColumn?&gt; GetColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmColumn?>

The column details, or null if the column does not exist.

GetColumnAsync

Gets the details of a column in the specified table.

csharp
Task&lt;DmColumn?&gt; GetColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction to use, or null.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task<DmColumn?>

The column details, or null if the column does not exist.

GetColumnAsync

Gets the details of a column in the specified table.

csharp
Task&lt;DmColumn?&gt; GetColumnAsync(
    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 transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmColumn?>

The column details, or null if the column does not exist.

GetColumnNamesAsync

Gets the names of columns in the specified table.

csharp
Task&lt;List&lt;string&gt;&gt; GetColumnNamesAsync(
    IDbConnection db,
    string columnNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnNameFilter (string) - An optional filter for column names.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of column names.

GetColumnNamesAsync

Gets the names of columns in the specified table.

csharp
Task&lt;List&lt;string&gt;&gt; GetColumnNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • columnNameFilter (string) - An optional filter for column names.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of column names.

GetColumnsAsync

Gets the details of columns in the specified table.

csharp
Task&lt;List&lt;DmColumn&gt;&gt; GetColumnsAsync(
    IDbConnection db,
    string columnNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnNameFilter (string) - An optional filter for column names.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmColumn>>

A list of column details.

GetColumnsAsync

Gets the details of columns in the specified table.

csharp
Task&lt;List&lt;DmColumn&gt;&gt; GetColumnsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • columnNameFilter (string) - An optional filter for column names.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmColumn>>

A list of column details.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    DmColumn column,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • column (DmColumn) - The column details.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnName,
    Type dotnetType,
    DmColumn} configureColumn,
    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.
  • dotnetType (Type) - The .NET type of the column.
  • configureColumn (DmColumn}) - An optional action to configure the column.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    string columnName,
    Type dotnetType,
    DmColumn} configureColumn,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • dotnetType (Type) - The .NET type of the column.
  • configureColumn (DmColumn}) - An optional action to configure the column.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    string columnName,
    Type dotnetType,
    string providerDataType,
    Int32} length,
    Int32} precision,
    Int32} scale,
    string checkExpression,
    string defaultExpression,
    bool isNullable,
    bool isPrimaryKey,
    bool isAutoIncrement,
    bool isUnique,
    bool isUnicode,
    bool isIndexed,
    bool isForeignKey,
    string referencedTableName,
    string referencedColumnName,
    DmForeignKeyAction} onDelete,
    DmForeignKeyAction} onUpdate,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • dotnetType (Type) - The .NET type of the column.
  • providerDataType (string) - The provider-specific data type of the column.
  • length (Int32}) - The length of the column.
  • precision (Int32}) - The precision of the column.
  • scale (Int32}) - The scale of the column.
  • checkExpression (string) - The check expression for the column.
  • defaultExpression (string) - The default expression for the column.
  • isNullable (bool) - Whether the column is nullable.
  • isPrimaryKey (bool) - Whether the column is a primary key.
  • isAutoIncrement (bool) - Whether the column is auto-incremented.
  • isUnique (bool) - Whether the column is unique.
  • isUnicode (bool) - Whether the column supports unicode characters.
  • isIndexed (bool) - Whether the column is indexed.
  • isForeignKey (bool) - Whether the column is a foreign key.
  • referencedTableName (string) - The referenced table name for the foreign key.
  • referencedColumnName (string) - The referenced column name for the foreign key.
  • onDelete (DmForeignKeyAction}) - The action to take on delete.
  • onUpdate (DmForeignKeyAction}) - The action to take on update.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} configureColumn,
    DmColumn} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • configureColumn (Object}}) - An optional action to configure the column.
  • tx (DmColumn}) - The transaction to use, or null.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

CreateColumnIfNotExistsAsync

Creates a column if it does not exist.

csharp
Task&lt;bool&gt; CreateColumnIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnName,
    Type dotnetType,
    string providerDataType,
    Int32} length,
    Int32} precision,
    Int32} scale,
    string checkExpression,
    string defaultExpression,
    bool isNullable,
    bool isPrimaryKey,
    bool isAutoIncrement,
    bool isUnique,
    bool isUnicode,
    bool isIndexed,
    bool isForeignKey,
    string referencedTableName,
    string referencedColumnName,
    DmForeignKeyAction} onDelete,
    DmForeignKeyAction} onUpdate,
    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.
  • dotnetType (Type) - The .NET type of the column.
  • providerDataType (string) - The provider-specific data type of the column.
  • length (Int32}) - The length of the column.
  • precision (Int32}) - The precision of the column.
  • scale (Int32}) - The scale of the column.
  • checkExpression (string) - The check expression for the column.
  • defaultExpression (string) - The default expression for the column.
  • isNullable (bool) - Whether the column is nullable.
  • isPrimaryKey (bool) - Whether the column is a primary key.
  • isAutoIncrement (bool) - Whether the column is auto-incremented.
  • isUnique (bool) - Whether the column is unique.
  • isUnicode (bool) - Whether the column supports unicode characters.
  • isIndexed (bool) - Whether the column is indexed.
  • isForeignKey (bool) - Whether the column is a foreign key.
  • referencedTableName (string) - The referenced table name for the foreign key.
  • referencedColumnName (string) - The referenced column name for the foreign key.
  • onDelete (DmForeignKeyAction}) - The action to take on delete.
  • onUpdate (DmForeignKeyAction}) - The action to take on update.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was created, otherwise false.

DropColumnIfExistsAsync

Drops a column if it exists.

csharp
Task&lt;bool&gt; DropColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was dropped, otherwise false.

DropColumnIfExistsAsync

Drops a column if it exists.

csharp
Task&lt;bool&gt; DropColumnIfExistsAsync(
    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 transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was dropped, otherwise false.

RenameColumnIfExistsAsync

Renames a column if it exists.

csharp
Task&lt;bool&gt; RenameColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    string newColumnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • newColumnName (string) - The new column name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was renamed, otherwise false.

RenameColumnIfExistsAsync

Renames a column if it exists.

csharp
Task&lt;bool&gt; RenameColumnIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnName,
    string newColumnName,
    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.
  • newColumnName (string) - The new column name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was renamed, otherwise false.

RenameColumnIfExistsAsync

Renames a column if it exists.

csharp
Task&lt;bool&gt; RenameColumnIfExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} oldColumnName,
    string tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column that will be renamed.
  • oldColumnName (Object}}) - The existing column name that will be renamed.
  • tx (string) - The transaction to use, or null.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the column was renamed, otherwise false.

GetDbProviderType

Gets the DbProviderType of the database connection.

csharp
DbProviderType GetDbProviderType(IDbConnection db)

Parameters

  • db (IDbConnection) - The database connection.

Returns

Type: DbProviderType

The of the database connection.

GetDatabaseVersionAsync

Gets the version of the database.

csharp
Task&lt;Version&gt; GetDatabaseVersionAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;Version&gt;

The version of the database.

GetProviderTypeMap

Gets the IDbProviderTypeMap of the database connection.

csharp
IDbProviderTypeMap GetProviderTypeMap(IDbConnection db)

Parameters

  • db (IDbConnection) - The database connection.

Returns

Type: IDbProviderTypeMap

The of the database connection.

GetDotnetTypeFromSqlType

Gets the .NET type descriptor from the SQL type.

csharp
DotnetTypeDescriptor GetDotnetTypeFromSqlType(IDbConnection db, string sqlType)

Parameters

  • db (IDbConnection) - The database connection.
  • sqlType (string) - The SQL type.

Returns

Type: DotnetTypeDescriptor

The corresponding to the SQL type.

GetSqlTypeFromDotnetType

Gets the SQL type from the .NET type descriptor.

csharp
string GetSqlTypeFromDotnetType(
    IDbConnection db,
    DotnetTypeDescriptor descriptor)

Parameters

  • db (IDbConnection) - The database connection.
  • descriptor (DotnetTypeDescriptor) - The .NET type descriptor.

Returns

Type: string

The SQL type corresponding to the .NET type descriptor.

DoesDefaultConstraintExistAsync

Checks if a default constraint exists.

csharp
Task&lt;bool&gt; DoesDefaultConstraintExistAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint exists, otherwise false.

DoesDefaultConstraintExistAsync

Checks if a default constraint exists.

csharp
Task&lt;bool&gt; DoesDefaultConstraintExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint exists, otherwise false.

DoesDefaultConstraintExistOnColumnAsync

Checks if a default constraint exists on a column.

csharp
Task&lt;bool&gt; DoesDefaultConstraintExistOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint exists on the column, otherwise false.

DoesDefaultConstraintExistOnColumnAsync

Checks if a default constraint exists on a column.

csharp
Task&lt;bool&gt; DoesDefaultConstraintExistOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint exists on the column, otherwise false.

DoesDefaultConstraintExistOnColumnAsync

Checks if a default constraint exists on a column.

csharp
Task&lt;bool&gt; DoesDefaultConstraintExistOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint exists on the column, otherwise false.

CreateDefaultConstraintIfNotExistsAsync

Creates a default constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateDefaultConstraintIfNotExistsAsync(
    IDbConnection db,
    DmDefaultConstraint constraint,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraint (DmDefaultConstraint) - The default constraint.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was created, otherwise false.

CreateDefaultConstraintIfNotExistsAsync

Creates a default constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateDefaultConstraintIfNotExistsAsync(
    IDbConnection db,
    string columnName,
    string constraintName,
    string expression,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • constraintName (string) - The constraint name.
  • expression (string) - The expression.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was created, otherwise false.

CreateDefaultConstraintIfNotExistsAsync

Creates a default constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateDefaultConstraintIfNotExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} constraintName,
    string expression,
    string tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • constraintName (Object}}) - The constraint name.
  • expression (string) - The expression.
  • tx (string) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was created, otherwise false.

CreateDefaultConstraintIfNotExistsAsync

Creates a default constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateDefaultConstraintIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string columnName,
    string constraintName,
    string expression,
    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.
  • constraintName (string) - The constraint name.
  • expression (string) - The expression.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was created, otherwise false.

GetDefaultConstraintAsync

Gets a default constraint.

csharp
Task&lt;DmDefaultConstraint?&gt; GetDefaultConstraintAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmDefaultConstraint?>

The default constraint.

GetDefaultConstraintAsync

Gets a default constraint.

csharp
Task&lt;DmDefaultConstraint?&gt; GetDefaultConstraintAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmDefaultConstraint?>

The default constraint.

GetDefaultConstraintNameOnColumnAsync

Gets the name of the default constraint on a column.

csharp
Task&lt;string?&gt; GetDefaultConstraintNameOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The name of the default constraint on the column.

GetDefaultConstraintNameOnColumnAsync

Gets the name of the default constraint on a column.

csharp
Task&lt;string?&gt; GetDefaultConstraintNameOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The name of the default constraint on the column.

GetDefaultConstraintNameOnColumnAsync

Gets the name of the default constraint on a column.

csharp
Task&lt;string?&gt; GetDefaultConstraintNameOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The name of the default constraint on the column.

GetDefaultConstraintNamesAsync

Gets the names of default constraints.

csharp
Task&lt;List&lt;string&gt;&gt; GetDefaultConstraintNamesAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of default constraint names.

GetDefaultConstraintNamesAsync

Gets the names of default constraints.

csharp
Task&lt;List&lt;string&gt;&gt; GetDefaultConstraintNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of default constraint names.

GetDefaultConstraintOnColumnAsync

Gets the default constraint on a column.

csharp
Task&lt;DmDefaultConstraint?&gt; GetDefaultConstraintOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmDefaultConstraint?>

The default constraint on the column.

GetDefaultConstraintOnColumnAsync

Gets the default constraint on a column.

csharp
Task&lt;DmDefaultConstraint?&gt; GetDefaultConstraintOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task<DmDefaultConstraint?>

The default constraint on the column.

GetDefaultConstraintOnColumnAsync

Gets the default constraint on a column.

csharp
Task&lt;DmDefaultConstraint?&gt; GetDefaultConstraintOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmDefaultConstraint?>

The default constraint on the column.

GetDefaultConstraintsAsync

Gets the default constraints.

csharp
Task&lt;List&lt;DmDefaultConstraint&gt;&gt; GetDefaultConstraintsAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmDefaultConstraint>>

A list of default constraints.

GetDefaultConstraintsAsync

Gets the default constraints.

csharp
Task&lt;List&lt;DmDefaultConstraint&gt;&gt; GetDefaultConstraintsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmDefaultConstraint>>

A list of default constraints.

DropDefaultConstraintIfExistsAsync

Drops a default constraint if it exists.

csharp
Task&lt;bool&gt; DropDefaultConstraintIfExistsAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropDefaultConstraintIfExistsAsync

Drops a default constraint if it exists.

csharp
Task&lt;bool&gt; DropDefaultConstraintIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropDefaultConstraintOnColumnIfExistsAsync

Drops a default constraint on a column if it exists.

csharp
Task&lt;bool&gt; DropDefaultConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropDefaultConstraintOnColumnIfExistsAsync

Drops a default constraint on a column if it exists.

csharp
Task&lt;bool&gt; DropDefaultConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DropDefaultConstraintOnColumnIfExistsAsync

Drops a default constraint on a column if it exists.

csharp
Task&lt;bool&gt; DropDefaultConstraintOnColumnIfExistsAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the constraint was dropped, otherwise false.

DoesForeignKeyConstraintExistOnColumnAsync

Checks if a foreign key constraint exists on a specific column.

csharp
Task&lt;bool&gt; DoesForeignKeyConstraintExistOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint exists, otherwise false.

DoesForeignKeyConstraintExistOnColumnAsync

Checks if a foreign key constraint exists on a specific column.

csharp
Task&lt;bool&gt; DoesForeignKeyConstraintExistOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint exists, otherwise false.

DoesForeignKeyConstraintExistOnColumnAsync

Checks if a foreign key constraint exists on a specific column.

csharp
Task&lt;bool&gt; DoesForeignKeyConstraintExistOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint exists, otherwise false.

DoesForeignKeyConstraintExistAsync

Checks if a foreign key constraint exists.

csharp
Task&lt;bool&gt; DoesForeignKeyConstraintExistAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint exists, otherwise false.

DoesForeignKeyConstraintExistAsync

Checks if a foreign key constraint exists.

csharp
Task&lt;bool&gt; DoesForeignKeyConstraintExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint exists, otherwise false.

CreateForeignKeyConstraintIfNotExistsAsync

Creates a foreign key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateForeignKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    DmForeignKeyConstraint constraint,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraint (DmForeignKeyConstraint) - The foreign key constraint.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was created, otherwise false.

CreateForeignKeyConstraintIfNotExistsAsync

Creates a foreign key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateForeignKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    string constraintName,
    DmOrderedColumn[] sourceColumns,
    string referencedTableName,
    DmOrderedColumn[] referencedColumns,
    DmForeignKeyAction onDelete,
    DmForeignKeyAction onUpdate,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • sourceColumns (DmOrderedColumn[]) - The source columns.
  • referencedTableName (string) - The referenced table name.
  • referencedColumns (DmOrderedColumn[]) - The referenced columns.
  • onDelete (DmForeignKeyAction) - The action on delete.
  • onUpdate (DmForeignKeyAction) - The action on update.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was created, otherwise false.

CreateForeignKeyConstraintIfNotExistsAsync

Creates a foreign key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateForeignKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    DmOrderedColumn[] sourceColumns,
    string referencedTableName,
    DmOrderedColumn[] referencedColumns,
    DmForeignKeyAction onDelete,
    DmForeignKeyAction onUpdate,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • sourceColumns (DmOrderedColumn[]) - The source columns.
  • referencedTableName (string) - The referenced table name.
  • referencedColumns (DmOrderedColumn[]) - The referenced columns.
  • onDelete (DmForeignKeyAction) - The action on delete.
  • onUpdate (DmForeignKeyAction) - The action on update.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was created, otherwise false.

GetForeignKeyConstraintOnColumnAsync

Gets the foreign key constraint on a specific column.

csharp
Task&lt;DmForeignKeyConstraint?&gt; GetForeignKeyConstraintOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmForeignKeyConstraint?>

The foreign key constraint if it exists, otherwise null.

GetForeignKeyConstraintOnColumnAsync

Gets the foreign key constraint on a specific column.

csharp
Task&lt;DmForeignKeyConstraint?&gt; GetForeignKeyConstraintOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task<DmForeignKeyConstraint?>

The foreign key constraint if it exists, otherwise null.

GetForeignKeyConstraintOnColumnAsync

Gets the foreign key constraint on a specific column.

csharp
Task&lt;DmForeignKeyConstraint?&gt; GetForeignKeyConstraintOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmForeignKeyConstraint?>

The foreign key constraint if it exists, otherwise null.

GetForeignKeyConstraintAsync

Gets the foreign key constraint.

csharp
Task&lt;DmForeignKeyConstraint?&gt; GetForeignKeyConstraintAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmForeignKeyConstraint?>

The foreign key constraint if it exists, otherwise null.

GetForeignKeyConstraintAsync

Gets the foreign key constraint.

csharp
Task&lt;DmForeignKeyConstraint?&gt; GetForeignKeyConstraintAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmForeignKeyConstraint?>

The foreign key constraint if it exists, otherwise null.

GetForeignKeyConstraintsAsync

Gets the foreign key constraints.

csharp
Task&lt;List&lt;DmForeignKeyConstraint&gt;&gt; GetForeignKeyConstraintsAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmForeignKeyConstraint>>

A list of foreign key constraints.

GetForeignKeyConstraintsAsync

Gets the foreign key constraints.

csharp
Task&lt;List&lt;DmForeignKeyConstraint&gt;&gt; GetForeignKeyConstraintsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmForeignKeyConstraint>>

A list of foreign key constraints.

GetForeignKeyConstraintNameOnColumnAsync

Gets the foreign key constraint name on a specific column.

csharp
Task&lt;string?&gt; GetForeignKeyConstraintNameOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The foreign key constraint name if it exists, otherwise null.

GetForeignKeyConstraintNameOnColumnAsync

Gets the foreign key constraint name on a specific column.

csharp
Task&lt;string?&gt; GetForeignKeyConstraintNameOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The foreign key constraint name if it exists, otherwise null.

GetForeignKeyConstraintNameOnColumnAsync

Gets the foreign key constraint name on a specific column.

csharp
Task&lt;string?&gt; GetForeignKeyConstraintNameOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

The foreign key constraint name if it exists, otherwise null.

GetForeignKeyConstraintNamesAsync

Gets the foreign key constraint names.

csharp
Task&lt;List&lt;string&gt;&gt; GetForeignKeyConstraintNamesAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of foreign key constraint names.

GetForeignKeyConstraintNamesAsync

Gets the foreign key constraint names.

csharp
Task&lt;List&lt;string&gt;&gt; GetForeignKeyConstraintNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of foreign key constraint names.

DropForeignKeyConstraintOnColumnIfExistsAsync

Drops the foreign key constraint on a specific column if it exists.

csharp
Task&lt;bool&gt; DropForeignKeyConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was dropped, otherwise false.

DropForeignKeyConstraintOnColumnIfExistsAsync

Drops the foreign key constraint on a specific column if it exists.

csharp
Task&lt;bool&gt; DropForeignKeyConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was dropped, otherwise false.

DropForeignKeyConstraintOnColumnIfExistsAsync

Drops the foreign key constraint on a specific column if it exists.

csharp
Task&lt;bool&gt; DropForeignKeyConstraintOnColumnIfExistsAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was dropped, otherwise false.

DropForeignKeyConstraintIfExistsAsync

Drops the foreign key constraint if it exists.

csharp
Task&lt;bool&gt; DropForeignKeyConstraintIfExistsAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was dropped, otherwise false.

DropForeignKeyConstraintIfExistsAsync

Drops the foreign key constraint if it exists.

csharp
Task&lt;bool&gt; DropForeignKeyConstraintIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the foreign key constraint was dropped, otherwise false.

DoesIndexExistOnColumnAsync

Checks if an index exists on a specified column.

csharp
Task&lt;bool&gt; DoesIndexExistOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index exists, otherwise false.

DoesIndexExistOnColumnAsync

Checks if an index exists on a specified column.

csharp
Task&lt;bool&gt; DoesIndexExistOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index exists, otherwise false.

DoesIndexExistOnColumnAsync

Checks if an index exists on a specified column.

csharp
Task&lt;bool&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index exists, otherwise false.

DoesIndexExistAsync

Checks if an index exists.

csharp
Task&lt;bool&gt; DoesIndexExistAsync(
    IDbConnection db,
    string indexName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexName (string) - The index name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index exists, otherwise false.

DoesIndexExistAsync

Checks if an index exists.

csharp
Task&lt;bool&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index exists, otherwise false.

CreateIndexIfNotExistsAsync

Creates an index if it does not exist.

csharp
Task&lt;bool&gt; CreateIndexIfNotExistsAsync(
    IDbConnection db,
    DmIndex index,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • index (DmIndex) - The index constraint.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index was created, otherwise false.

CreateIndexIfNotExistsAsync

Creates an index if it does not exist.

csharp
Task&lt;bool&gt; CreateIndexIfNotExistsAsync(
    IDbConnection db,
    string indexName,
    DmOrderedColumn[] columns,
    bool isUnique,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexName (string) - The index name.
  • columns (DmOrderedColumn[]) - The columns in the index.
  • isUnique (bool) - Whether the index is unique.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index was created, otherwise false.

CreateIndexIfNotExistsAsync

Creates an index if it does not exist.

csharp
Task&lt;bool&gt; 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 in the index.
  • isUnique (bool) - Whether the index is unique.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index was created, otherwise false.

GetIndexesOnColumnAsync

Gets the indexes on a specified column.

csharp
Task&lt;List&lt;DmIndex&gt;&gt; GetIndexesOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmIndex>>

A list of indexes on the column.

GetIndexesOnColumnAsync

Gets the indexes on a specified column.

csharp
Task&lt;List&lt;DmIndex&gt;&gt; GetIndexesOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task<List<DmIndex>>

A list of indexes on the column.

GetIndexesOnColumnAsync

Gets the indexes on a specified column.

csharp
Task&lt;List&lt;DmIndex&gt;&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmIndex>>

A list of indexes on the column.

GetIndexAsync

Gets a specified index.

csharp
Task&lt;DmIndex?&gt; GetIndexAsync(
    IDbConnection db,
    string indexName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexName (string) - The index name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmIndex?>

The index if found, otherwise null.

GetIndexAsync

Gets a specified index.

csharp
Task&lt;DmIndex?&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmIndex?>

The index if found, otherwise null.

GetIndexesAsync

Gets the indexes on a specified table.

csharp
Task&lt;List&lt;DmIndex&gt;&gt; GetIndexesAsync(
    IDbConnection db,
    string indexNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexNameFilter (string) - The index name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmIndex>>

A list of indexes on the table.

GetIndexesAsync

Gets the indexes on a specified table.

csharp
Task&lt;List&lt;DmIndex&gt;&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmIndex>>

A list of indexes on the table.

GetIndexNamesOnColumnAsync

Gets the names of indexes on a specified column.

csharp
Task&lt;List&lt;string&gt;&gt; GetIndexNamesOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of index names on the column.

GetIndexNamesOnColumnAsync

Gets the names of indexes on a specified column.

csharp
Task&lt;List&lt;string&gt;&gt; GetIndexNamesOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of index names on the column.

GetIndexNamesOnColumnAsync

Gets the names of indexes on a specified column.

csharp
Task&lt;List&lt;string&gt;&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of index names on the column.

GetIndexNamesAsync

Gets the names of indexes on a specified table.

csharp
Task&lt;List&lt;string&gt;&gt; GetIndexNamesAsync(
    IDbConnection db,
    string indexNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexNameFilter (string) - The index name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of index names on the table.

GetIndexNamesAsync

Gets the names of indexes on a specified table.

csharp
Task&lt;List&lt;string&gt;&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of index names on the table.

DropIndexesOnColumnIfExistsAsync

Drops indexes on a specified column if they exist.

csharp
Task&lt;bool&gt; DropIndexesOnColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the indexes were dropped, otherwise false.

DropIndexesOnColumnIfExistsAsync

Drops indexes on a specified column if they exist.

csharp
Task&lt;bool&gt; DropIndexesOnColumnIfExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - An expression representing the column.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the indexes were dropped, otherwise false.

DropIndexesOnColumnIfExistsAsync

Drops indexes on a specified column if they exist.

csharp
Task&lt;bool&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the indexes were dropped, otherwise false.

DropIndexIfExistsAsync

Drops a specified index if it exists.

csharp
Task&lt;bool&gt; DropIndexIfExistsAsync(
    IDbConnection db,
    string indexName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • indexName (string) - The index name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index was dropped, otherwise false.

DropIndexIfExistsAsync

Drops a specified index if it exists.

csharp
Task&lt;bool&gt; 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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the index was dropped, otherwise false.

DoesPrimaryKeyConstraintExistAsync

Checks if a primary key constraint exists in the specified table.

csharp
Task&lt;bool&gt; DoesPrimaryKeyConstraintExistAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint exists, otherwise false.

DoesPrimaryKeyConstraintExistAsync

Checks if a primary key constraint exists in the specified table.

csharp
Task&lt;bool&gt; DoesPrimaryKeyConstraintExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint exists, otherwise false.

CreatePrimaryKeyConstraintIfNotExistsAsync

Creates a primary key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreatePrimaryKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    DmPrimaryKeyConstraint constraint,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraint (DmPrimaryKeyConstraint) - The primary key constraint.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint was created, otherwise false.

CreatePrimaryKeyConstraintIfNotExistsAsync

Creates a primary key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreatePrimaryKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    string constraintName,
    DmOrderedColumn[] columns,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • columns (DmOrderedColumn[]) - The columns that make up the primary key.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint was created, otherwise false.

CreatePrimaryKeyConstraintIfNotExistsAsync

Creates a primary key constraint if it does not exist.

csharp
Task&lt;bool&gt; CreatePrimaryKeyConstraintIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    DmOrderedColumn[] columns,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • columns (DmOrderedColumn[]) - The columns that make up the primary key.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint was created, otherwise false.

GetPrimaryKeyConstraintAsync

Gets the primary key constraint for the specified table.

csharp
Task&lt;DmPrimaryKeyConstraint?&gt; GetPrimaryKeyConstraintAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmPrimaryKeyConstraint?>

The primary key constraint, or null if it does not exist.

GetPrimaryKeyConstraintAsync

Gets the primary key constraint for the specified table.

csharp
Task&lt;DmPrimaryKeyConstraint?&gt; GetPrimaryKeyConstraintAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmPrimaryKeyConstraint?>

The primary key constraint, or null if it does not exist.

DropPrimaryKeyConstraintIfExistsAsync

Drops the primary key constraint if it exists.

csharp
Task&lt;bool&gt; DropPrimaryKeyConstraintIfExistsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint was dropped, otherwise false.

DropPrimaryKeyConstraintIfExistsAsync

Drops the primary key constraint if it exists.

csharp
Task&lt;bool&gt; DropPrimaryKeyConstraintIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the primary key constraint was dropped, otherwise false.

SupportsSchemas

Determines whether the database supports schemas.

csharp
bool SupportsSchemas(IDbConnection db)

Parameters

  • db (IDbConnection) - The database connection.

Returns

Type: bool

True if the database supports schemas; otherwise, false.

GetSchemaQualifiedTableName

Gets the schema-qualified table name.

csharp
string GetSchemaQualifiedTableName(
    IDbConnection db,
    string schemaName,
    string tableName)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.

Returns

Type: string

The schema-qualified table name.

SupportsCheckConstraintsAsync

Determines whether the database supports check constraints asynchronously.

csharp
Task&lt;bool&gt; SupportsCheckConstraintsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the database supports check constraints; otherwise, false.

SupportsOrderedKeysInConstraintsAsync

Determines whether the database supports ordered keys in constraints asynchronously.

csharp
Task&lt;bool&gt; SupportsOrderedKeysInConstraintsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the database supports ordered keys in constraints; otherwise, false.

CreateSchemaIfNotExistsAsync

Creates the schema if it does not exist asynchronously.

csharp
Task&lt;bool&gt; CreateSchemaIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the schema was created; otherwise, false.

DoesSchemaExistAsync

Determines whether the schema exists asynchronously.

csharp
Task&lt;bool&gt; DoesSchemaExistAsync(
    IDbConnection db,
    string schemaName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the schema exists; otherwise, false.

GetSchemaNamesAsync

Gets the schema names asynchronously.

csharp
Task&lt;List&lt;string&gt;&gt; GetSchemaNamesAsync(
    IDbConnection db,
    string schemaNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaNameFilter (string) - The schema name filter.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of schema names.

DropSchemaIfExistsAsync

Drops the schema if it exists asynchronously.

csharp
Task&lt;bool&gt; DropSchemaIfExistsAsync(
    IDbConnection db,
    string schemaName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the schema was dropped; otherwise, false.

DoesTableExistAsync

Checks if a table exists in the database.

csharp
Task&lt;bool&gt; DoesTableExistAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table exists, otherwise false.

DoesTableExistAsync

Checks if a table exists in the database.

csharp
Task&lt;bool&gt; DoesTableExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table exists, otherwise false.

CreateTablesIfNotExistsAsync

Creates tables if they do not exist.

csharp
Task CreateTablesIfNotExistsAsync(
    IDbConnection db,
    Type} tables,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tables (Type}) - The table type definitions.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task

A task that represents the asynchronous operation.

CreateTablesIfNotExistsAsync

Creates tables if they do not exist.

csharp
Task CreateTablesIfNotExistsAsync(
    IDbConnection db,
    Type} tables,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tables (Type}) - The table type definitions.
  • tx (IDbTransaction) - The database transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task

A task that represents the asynchronous operation.

CreateTableIfNotExistsAsync

Creates a table if it does not exist.

csharp
Task&lt;bool&gt; CreateTableIfNotExistsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was created, otherwise false.

CreateTableIfNotExistsAsync

Creates a table if it does not exist.

csharp
Task&lt;bool&gt; CreateTableIfNotExistsAsync(
    IDbConnection db,
    DmTable table,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • table (DmTable) - The table definition.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was created, otherwise false.

CreateTableIfNotExistsAsync

Creates a table if it does not exist.

csharp
Task&lt;bool&gt; CreateTableIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    DmColumn[] columns,
    DmPrimaryKeyConstraint primaryKey,
    DmCheckConstraint[] checkConstraints,
    DmDefaultConstraint[] defaultConstraints,
    DmUniqueConstraint[] uniqueConstraints,
    DmForeignKeyConstraint[] foreignKeyConstraints,
    DmIndex[] indexes,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • columns (DmColumn[]) - The columns of the table.
  • primaryKey (DmPrimaryKeyConstraint) - The primary key constraint.
  • checkConstraints (DmCheckConstraint[]) - The check constraints.
  • defaultConstraints (DmDefaultConstraint[]) - The default constraints.
  • uniqueConstraints (DmUniqueConstraint[]) - The unique constraints.
  • foreignKeyConstraints (DmForeignKeyConstraint[]) - The foreign key constraints.
  • indexes (DmIndex[]) - The indexes.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was created, otherwise false.

GetTableAsync

Gets the table definition.

csharp
Task&lt;DmTable?&gt; GetTableAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmTable?>

The table definition.

GetTableAsync

Gets the table definition.

csharp
Task&lt;DmTable?&gt; GetTableAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmTable?>

The table definition.

GetTablesAsync

Gets the list of table definitions.

csharp
Task&lt;List&lt;DmTable&gt;&gt; GetTablesAsync(
    IDbConnection db,
    string schemaName,
    string tableNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableNameFilter (string) - The table name filter.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmTable>>

The list of table definitions.

GetTableNamesAsync

Gets the list of table names.

csharp
Task&lt;List&lt;string&gt;&gt; GetTableNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableNameFilter (string) - The table name filter.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

The list of table names.

DropTableIfExistsAsync

Drops a table if it exists.

csharp
Task&lt;bool&gt; DropTableIfExistsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was dropped, otherwise false.

DropTableIfExistsAsync

Drops a table if it exists.

csharp
Task&lt;bool&gt; DropTableIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was dropped, otherwise false.

RenameTableIfExistsAsync

Renames a table if it exists.

csharp
Task&lt;bool&gt; RenameTableIfExistsAsync(
    IDbConnection db,
    string oldTableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • oldTableName (string) - The old table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was renamed, otherwise false.

RenameTableIfExistsAsync

Renames a table if it exists.

csharp
Task&lt;bool&gt; RenameTableIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string newTableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • newTableName (string) - The new table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was renamed, otherwise false.

TruncateTableIfExistsAsync

Truncates a table if it exists.

csharp
Task&lt;bool&gt; TruncateTableIfExistsAsync(
    IDbConnection db,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was truncated, otherwise false.

TruncateTableIfExistsAsync

Truncates a table if it exists.

csharp
Task&lt;bool&gt; TruncateTableIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the table was truncated, otherwise false.

DoesUniqueConstraintExistOnColumnAsync

Checks if a unique constraint exists on a specified column.

csharp
Task&lt;bool&gt; DoesUniqueConstraintExistOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint exists.

DoesUniqueConstraintExistOnColumnAsync

Checks if a unique constraint exists on a specified column.

csharp
Task&lt;bool&gt; DoesUniqueConstraintExistOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint exists.

DoesUniqueConstraintExistOnColumnAsync

Checks if a unique constraint exists on a specified column.

csharp
Task&lt;bool&gt; DoesUniqueConstraintExistOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint exists.

DoesUniqueConstraintExistAsync

Checks if a unique constraint exists.

csharp
Task&lt;bool&gt; DoesUniqueConstraintExistAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint exists.

DoesUniqueConstraintExistAsync

Checks if a unique constraint exists.

csharp
Task&lt;bool&gt; DoesUniqueConstraintExistAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint exists.

CreateUniqueConstraintIfNotExistsAsync

Creates a unique constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateUniqueConstraintIfNotExistsAsync(
    IDbConnection db,
    DmUniqueConstraint constraint,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraint (DmUniqueConstraint) - The unique constraint.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was created.

CreateUniqueConstraintIfNotExistsAsync

Creates a unique constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateUniqueConstraintIfNotExistsAsync(
    IDbConnection db,
    string constraintName,
    DmOrderedColumn[] columns,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • columns (DmOrderedColumn[]) - The columns.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was created.

CreateUniqueConstraintIfNotExistsAsync

Creates a unique constraint if it does not exist.

csharp
Task&lt;bool&gt; CreateUniqueConstraintIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    DmOrderedColumn[] columns,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • columns (DmOrderedColumn[]) - The columns.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was created.

GetUniqueConstraintOnColumnAsync

Gets the unique constraint on a specified column.

csharp
Task&lt;DmUniqueConstraint?&gt; GetUniqueConstraintOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmUniqueConstraint?>

A task that represents the asynchronous operation. The task result contains the unique constraint.

GetUniqueConstraintOnColumnAsync

Gets the unique constraint on a specified column.

csharp
Task&lt;DmUniqueConstraint?&gt; GetUniqueConstraintOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task<DmUniqueConstraint?>

A task that represents the asynchronous operation. The task result contains the unique constraint.

GetUniqueConstraintOnColumnAsync

Gets the unique constraint on a specified column.

csharp
Task&lt;DmUniqueConstraint?&gt; GetUniqueConstraintOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmUniqueConstraint?>

A task that represents the asynchronous operation. The task result contains the unique constraint.

GetUniqueConstraintAsync

Gets the unique constraint.

csharp
Task&lt;DmUniqueConstraint?&gt; GetUniqueConstraintAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmUniqueConstraint?>

A task that represents the asynchronous operation. The task result contains the unique constraint.

GetUniqueConstraintAsync

Gets the unique constraint.

csharp
Task&lt;DmUniqueConstraint?&gt; GetUniqueConstraintAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmUniqueConstraint?>

A task that represents the asynchronous operation. The task result contains the unique constraint.

GetUniqueConstraintsAsync

Gets the unique constraints.

csharp
Task&lt;List&lt;DmUniqueConstraint&gt;&gt; GetUniqueConstraintsAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmUniqueConstraint>>

A task that represents the asynchronous operation. The task result contains the list of unique constraints.

GetUniqueConstraintsAsync

Gets the unique constraints.

csharp
Task&lt;List&lt;DmUniqueConstraint&gt;&gt; GetUniqueConstraintsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmUniqueConstraint>>

A task that represents the asynchronous operation. The task result contains the list of unique constraints.

GetUniqueConstraintNameOnColumnAsync

Gets the unique constraint name on a specified column.

csharp
Task&lt;string?&gt; GetUniqueConstraintNameOnColumnAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

A task that represents the asynchronous operation. The task result contains the unique constraint name.

GetUniqueConstraintNameOnColumnAsync

Gets the unique constraint name on a specified column.

csharp
Task&lt;string?&gt; GetUniqueConstraintNameOnColumnAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

A task that represents the asynchronous operation. The task result contains the unique constraint name.

GetUniqueConstraintNameOnColumnAsync

Gets the unique constraint name on a specified column.

csharp
Task&lt;string?&gt; GetUniqueConstraintNameOnColumnAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;string?&gt;

A task that represents the asynchronous operation. The task result contains the unique constraint name.

GetUniqueConstraintNamesAsync

Gets the unique constraint names.

csharp
Task&lt;List&lt;string&gt;&gt; GetUniqueConstraintNamesAsync(
    IDbConnection db,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A task that represents the asynchronous operation. The task result contains the list of unique constraint names.

GetUniqueConstraintNamesAsync

Gets the unique constraint names.

csharp
Task&lt;List&lt;string&gt;&gt; GetUniqueConstraintNamesAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintNameFilter (string) - The constraint name filter.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A task that represents the asynchronous operation. The task result contains the list of unique constraint names.

DropUniqueConstraintOnColumnIfExistsAsync

Drops the unique constraint on a specified column if it exists.

csharp
Task&lt;bool&gt; DropUniqueConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    string columnName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnName (string) - The column name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was dropped.

DropUniqueConstraintOnColumnIfExistsAsync

Drops the unique constraint on a specified column if it exists.

csharp
Task&lt;bool&gt; DropUniqueConstraintOnColumnIfExistsAsync(
    IDbConnection db,
    Func{``0 columnExpression,
    Object}} tx,
    IDbTransaction cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • columnExpression (Func{``0) - The column expression.
  • tx (Object}}) - The transaction.
  • cancellationToken (IDbTransaction) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was dropped.

DropUniqueConstraintOnColumnIfExistsAsync

Drops the unique constraint on a specified column if it exists.

csharp
Task&lt;bool&gt; DropUniqueConstraintOnColumnIfExistsAsync(
    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 transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was dropped.

DropUniqueConstraintIfExistsAsync

Drops the unique constraint if it exists.

csharp
Task&lt;bool&gt; DropUniqueConstraintIfExistsAsync(
    IDbConnection db,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was dropped.

DropUniqueConstraintIfExistsAsync

Drops the unique constraint if it exists.

csharp
Task&lt;bool&gt; DropUniqueConstraintIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string tableName,
    string constraintName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • tableName (string) - The table name.
  • constraintName (string) - The constraint name.
  • tx (IDbTransaction) - The transaction.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

A task that represents the asynchronous operation. The task result contains a boolean indicating whether the unique constraint was dropped.

DoesViewExistAsync

Checks if a view exists in the database.

csharp
Task&lt;bool&gt; DoesViewExistAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The view name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view exists, otherwise false.

CreateViewIfNotExistsAsync

Creates a view if it does not exist.

csharp
Task&lt;bool&gt; CreateViewIfNotExistsAsync(
    IDbConnection db,
    DmView view,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • view (DmView) - The view definition.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view was created, otherwise false.

CreateViewIfNotExistsAsync

Creates a view if it does not exist.

csharp
Task&lt;bool&gt; CreateViewIfNotExistsAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    string viewDefinition,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The view name.
  • viewDefinition (string) - The view definition.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view was created, otherwise false.

UpdateViewIfExistsAsync

Updates a view if it exists.

csharp
Task&lt;bool&gt; UpdateViewIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    string viewDefinition,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The view name.
  • viewDefinition (string) - The view definition.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view was updated, otherwise false.

GetViewAsync

Gets a view from the database.

csharp
Task&lt;DmView?&gt; GetViewAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The view name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<DmView?>

The view if found, otherwise null.

GetViewsAsync

Gets a list of views from the database.

csharp
Task&lt;List&lt;DmView&gt;&gt; GetViewsAsync(
    IDbConnection db,
    string schemaName,
    string viewNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewNameFilter (string) - The view name filter.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task<List<DmView>>

A list of views.

GetViewNamesAsync

Gets a list of view names from the database.

csharp
Task&lt;List&lt;string&gt;&gt; GetViewNamesAsync(
    IDbConnection db,
    string schemaName,
    string viewNameFilter,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewNameFilter (string) - The view name filter.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;List&lt;string&gt;&gt;

A list of view names.

DropViewIfExistsAsync

Drops a view if it exists.

csharp
Task&lt;bool&gt; DropViewIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The view name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view was dropped, otherwise false.

RenameViewIfExistsAsync

Renames a view if it exists.

csharp
Task&lt;bool&gt; RenameViewIfExistsAsync(
    IDbConnection db,
    string schemaName,
    string viewName,
    string newViewName,
    IDbTransaction tx,
    CancellationToken cancellationToken)

Parameters

  • db (IDbConnection) - The database connection.
  • schemaName (string) - The schema name.
  • viewName (string) - The current view name.
  • newViewName (string) - The new view name.
  • tx (IDbTransaction) - The transaction to use.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns

Type: Task&lt;bool&gt;

True if the view was renamed, otherwise false.

GetType

csharp
GetType()

ToString

csharp
ToString()

Equals

csharp
Equals()

GetHashCode

csharp
GetHashCode()