SqliteMethods ​
Namespace: MJCZone.DapperMatic.Providers.Sqlite
Assembly: MJCZone.DapperMatic
Summary ​
Provides SQLite specific database methods.
Inheritance ​
Base Class: DatabaseMethodsBase
Implemented Interfaces:
- ISqliteMethods
- IDatabaseMethods
- IDatabaseTableMethods
- IDatabaseColumnMethods
- IDatabaseIndexMethods
- IDatabaseCheckConstraintMethods
- IDatabaseDefaultConstraintMethods
- IDatabasePrimaryKeyConstraintMethods
- IDatabaseUniqueConstraintMethods
- IDatabaseForeignKeyConstraintMethods
- IDatabaseSchemaMethods
- IDatabaseViewMethods
public
Contents ​
Methods (101) | Properties (4)
Methods ​
Method | Summary |
---|---|
CreateCheckConstraintIfNotExistsAsync | |
DropCheckConstraintIfExistsAsync | |
CreateColumnIfNotExistsAsync | Creates a column if it does not already exist in the specified table. |
DropColumnIfExistsAsync | Drops a column if it exists in the specified table. |
GetDatabaseVersionAsync | |
CreateDefaultConstraintIfNotExistsAsync | |
DropDefaultConstraintIfExistsAsync | |
DropDefaultConstraintOnColumnIfExistsAsync | |
CreateForeignKeyConstraintIfNotExistsAsync | |
DropForeignKeyConstraintIfExistsAsync | |
CreatePrimaryKeyConstraintIfNotExistsAsync | |
DropPrimaryKeyConstraintIfExistsAsync | |
GetTablesAsync | |
TruncateTableIfExistsAsync | Truncates the table if it exists asynchronously. |
CreateUniqueConstraintIfNotExistsAsync | |
DropUniqueConstraintIfExistsAsync | |
DoesCheckConstraintExistAsync | Checks if a check constraint exists in the specified table. |
DoesCheckConstraintExistOnColumnAsync | Checks if a check constraint exists on a specific column in the specified table. |
CreateCheckConstraintIfNotExistsAsync | Creates a check constraint if it does not already exist. |
GetCheckConstraintAsync | Gets the details of a check constraint. |
GetCheckConstraintNameOnColumnAsync | Gets the name of a check constraint on a specific column. |
GetCheckConstraintNamesAsync | Gets the names of all check constraints in the specified table. |
GetCheckConstraintOnColumnAsync | Gets the details of a check constraint on a specific column. |
GetCheckConstraintsAsync | Gets the details of all check constraints in the specified table. |
DropCheckConstraintOnColumnIfExistsAsync | Drops a check constraint on a specific column if it exists. |
DoesColumnExistAsync | Checks if a column exists in the specified table. |
CreateColumnIfNotExistsAsync | |
GetColumnAsync | Retrieves a column from the specified table. |
GetColumnNamesAsync | Retrieves the names of columns from the specified table. |
GetColumnsAsync | Retrieves columns from the specified table. |
RenameColumnIfExistsAsync | Renames a column if it exists in the specified table. |
SupportsCheckConstraintsAsync | Determines whether the provider supports check constraints. |
SupportsOrderedKeysInConstraintsAsync | Determines whether the provider supports ordered keys in constraints. |
SupportsDefaultConstraintsAsync | Determines whether the provider supports default constraints. |
GetDotnetTypeFromSqlType | Gets the .NET type descriptor from the SQL type. |
GetSqlTypeFromDotnetType | Gets the SQL type from the .NET type descriptor. |
GetSchemaQualifiedIdentifierName | Gets the schema-qualified identifier name. |
DoesDefaultConstraintExistAsync | Checks if a default constraint exists in the database. |
DoesDefaultConstraintExistOnColumnAsync | Checks if a default constraint exists on a specific column in the database. |
CreateDefaultConstraintIfNotExistsAsync | Creates a default constraint if it does not exist. |
GetDefaultConstraintAsync | Gets a default constraint from the database. |
GetDefaultConstraintNameOnColumnAsync | Gets the name of the default constraint on a specific column. |
GetDefaultConstraintNamesAsync | Gets the names of all default constraints in the database. |
GetDefaultConstraintOnColumnAsync | Gets the default constraint on a specific column. |
GetDefaultConstraintsAsync | Gets all default constraints in the database. |
DoesForeignKeyConstraintExistAsync | Checks if a foreign key constraint exists. |
DoesForeignKeyConstraintExistOnColumnAsync | Checks if a foreign key constraint exists on a specific column. |
CreateForeignKeyConstraintIfNotExistsAsync | Creates a foreign key constraint if it does not exist. |
GetForeignKeyConstraintAsync | Gets a foreign key constraint. |
GetForeignKeyConstraintNameOnColumnAsync | Gets the name of the foreign key constraint on a specific column. |
GetForeignKeyConstraintNamesAsync | Gets the names of the foreign key constraints. |
GetForeignKeyConstraintOnColumnAsync | Gets the foreign key constraint on a specific column. |
GetForeignKeyConstraintsAsync | Gets the foreign key constraints. |
DropForeignKeyConstraintOnColumnIfExistsAsync | Drops the foreign key constraint on a specific column if it exists. |
DoesIndexExistAsync | Checks if an index exists in the database. |
DoesIndexExistOnColumnAsync | Checks if an index exists on a specific column in the database. |
CreateIndexIfNotExistsAsync | Creates an index if it does not already exist. |
CreateIndexIfNotExistsAsync | Creates an index if it does not already exist. |
GetIndexAsync | Retrieves an index from the database. |
GetIndexesAsync | Retrieves a list of indexes from the database. |
GetIndexNamesOnColumnAsync | Retrieves a list of index names on a specific column from the database. |
GetIndexNamesAsync | Retrieves a list of index names from the database. |
GetIndexesOnColumnAsync | Retrieves a list of indexes on a specific column from the database. |
DropIndexIfExistsAsync | Drops an index if it exists in the database. |
DropIndexesOnColumnIfExistsAsync | Drops indexes on a specific column if they exist in the database. |
DoesPrimaryKeyConstraintExistAsync | Checks if a primary key constraint exists on the specified table. |
CreatePrimaryKeyConstraintIfNotExistsAsync | Creates a primary key constraint if it does not already exist. |
GetPrimaryKeyConstraintAsync | Gets the primary key constraint for the specified table. |
DoesSchemaExistAsync | Checks if a schema exists in the database. |
CreateSchemaIfNotExistsAsync | Creates a schema if it does not exist in the database. |
GetSchemaNamesAsync | Retrieves the list of schema names from the database. |
DropSchemaIfExistsAsync | Drops a schema if it exists in the database. |
DoesTableExistAsync | Checks if a table exists in the database. |
CreateTablesIfNotExistsAsync | Creates tables if they do not exist. |
CreateTableIfNotExistsAsync | Creates a table if it does not exist. |
CreateTableIfNotExistsAsync | Creates a table if it does not exist. |
GetTableAsync | Gets a table from the database. |
GetTableNamesAsync | Gets the names of tables in the database. |
DropTableIfExistsAsync | Drops a table if it exists. |
RenameTableIfExistsAsync | Renames a table if it exists. |
DoesUniqueConstraintExistAsync | Checks if a unique constraint exists in the specified table. |
DoesUniqueConstraintExistOnColumnAsync | Checks if a unique constraint exists on the specified column. |
CreateUniqueConstraintIfNotExistsAsync | Creates a unique constraint if it does not already exist. |
GetUniqueConstraintAsync | Gets a unique constraint by name. |
GetUniqueConstraintNameOnColumnAsync | Gets the name of the unique constraint on the specified column. |
GetUniqueConstraintNamesAsync | Gets the names of all unique constraints in the specified table. |
GetUniqueConstraintOnColumnAsync | Gets the unique constraint on the specified column. |
GetUniqueConstraintsAsync | Gets all unique constraints in the specified table. |
DropUniqueConstraintOnColumnIfExistsAsync | Drops a unique constraint on the specified column if it exists. |
DoesViewExistAsync | Checks if a view exists in the database. |
CreateViewIfNotExistsAsync | Creates a view if it does not exist. |
CreateViewIfNotExistsAsync | Creates a view if it does not exist. |
GetViewAsync | Gets a view from the database. |
GetViewNamesAsync | Gets the names of views from the database. |
GetViewsAsync | Gets views from the database. |
DropViewIfExistsAsync | Drops a view if it exists. |
RenameViewIfExistsAsync | Renames a view if it exists. |
GetType | |
ToString | |
Equals | |
GetHashCode |
CreateCheckConstraintIfNotExistsAsync ​
Task<bool> CreateCheckConstraintIfNotExistsAsync()
Returns ​
Type: Task<bool>
DropCheckConstraintIfExistsAsync ​
Task<bool> DropCheckConstraintIfExistsAsync()
Returns ​
Type: Task<bool>
CreateColumnIfNotExistsAsync ​
Creates a column if it does not already exist in the specified table.
Task<bool> CreateColumnIfNotExistsAsync(IDbConnection db, DmColumn column, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- column (DmColumn) - The column to create.
- tx (IDbTransaction) - The transaction to use, or null.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
Type: Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the column was created.
DropColumnIfExistsAsync ​
Drops a column if it exists in the specified table.
Task<bool> 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<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the column was dropped.
GetDatabaseVersionAsync ​
Task<Version> GetDatabaseVersionAsync()
Returns ​
Type: Task<Version>
CreateDefaultConstraintIfNotExistsAsync ​
Task<bool> CreateDefaultConstraintIfNotExistsAsync()
Returns ​
Type: Task<bool>
DropDefaultConstraintIfExistsAsync ​
Task<bool> DropDefaultConstraintIfExistsAsync()
Returns ​
Type: Task<bool>
DropDefaultConstraintOnColumnIfExistsAsync ​
Task<bool> DropDefaultConstraintOnColumnIfExistsAsync()
Returns ​
Type: Task<bool>
CreateForeignKeyConstraintIfNotExistsAsync ​
Task<bool> CreateForeignKeyConstraintIfNotExistsAsync()
Returns ​
Type: Task<bool>
DropForeignKeyConstraintIfExistsAsync ​
Task<bool> DropForeignKeyConstraintIfExistsAsync()
Returns ​
Type: Task<bool>
CreatePrimaryKeyConstraintIfNotExistsAsync ​
Task<bool> CreatePrimaryKeyConstraintIfNotExistsAsync()
Returns ​
Type: Task<bool>
DropPrimaryKeyConstraintIfExistsAsync ​
Task<bool> DropPrimaryKeyConstraintIfExistsAsync()
Returns ​
Type: Task<bool>
GetTablesAsync ​
Task<List<DmTable>> GetTablesAsync()
Returns ​
Type: Task<List<DmTable>>
TruncateTableIfExistsAsync ​
Truncates the table if it exists asynchronously.
Task<bool> 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
Type: Task<bool>
True if the table was truncated, otherwise false.
CreateUniqueConstraintIfNotExistsAsync ​
Task<bool> CreateUniqueConstraintIfNotExistsAsync()
Returns ​
Type: Task<bool>
DropUniqueConstraintIfExistsAsync ​
Task<bool> DropUniqueConstraintIfExistsAsync()
Returns ​
Type: Task<bool>
DoesCheckConstraintExistAsync ​
Checks if a check constraint exists in the specified table.
void 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 ​
True if the check constraint exists, otherwise false.
DoesCheckConstraintExistOnColumnAsync ​
Checks if a check constraint exists on a specific column in the specified table.
void 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 ​
True if the check constraint exists on the column, otherwise false.
CreateCheckConstraintIfNotExistsAsync ​
Creates a check constraint if it does not already exist.
void CreateCheckConstraintIfNotExistsAsync(IDbConnection db, DmCheckConstraint constraint, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- constraint (DmCheckConstraint) - The check constraint details.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the check constraint was created, otherwise false.
GetCheckConstraintAsync ​
Gets the details of a check constraint.
void 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 ​
The check constraint details, or null if not found.
GetCheckConstraintNameOnColumnAsync ​
Gets the name of a check constraint on a specific column.
void 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 ​
The check constraint name, or null if not found.
GetCheckConstraintNamesAsync ​
Gets the names of all check constraints in the specified table.
void 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 ​
A list of check constraint names.
GetCheckConstraintOnColumnAsync ​
Gets the details of a check constraint on a specific column.
void 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 ​
The check constraint details, or null if not found.
GetCheckConstraintsAsync ​
Gets the details of all check constraints in the specified table.
void 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 ​
A list of check constraint details.
DropCheckConstraintOnColumnIfExistsAsync ​
Drops a check constraint on a specific column if it exists.
void 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 ​
True if the check constraint was dropped, otherwise false.
DoesColumnExistAsync ​
Checks if a column exists in the specified table.
void 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 database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the column exists, otherwise false.
CreateColumnIfNotExistsAsync ​
void CreateColumnIfNotExistsAsync()
GetColumnAsync ​
Retrieves a column from the specified table.
void 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 database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The column definition if found, otherwise null.
GetColumnNamesAsync ​
Retrieves the names of columns from the specified table.
void 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) - The column name filter.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of column names.
GetColumnsAsync ​
Retrieves columns from the specified table.
void 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) - The column name filter.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of column definitions.
RenameColumnIfExistsAsync ​
Renames a column if it exists in the specified table.
void 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 database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the column was renamed, otherwise false.
SupportsCheckConstraintsAsync ​
Determines whether the provider supports check constraints.
void SupportsCheckConstraintsAsync(IDbConnection db, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the provider supports check constraints.
SupportsOrderedKeysInConstraintsAsync ​
Determines whether the provider supports ordered keys in constraints.
void SupportsOrderedKeysInConstraintsAsync(IDbConnection db, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the provider supports ordered keys in constraints.
SupportsDefaultConstraintsAsync ​
Determines whether the provider supports default constraints.
void SupportsDefaultConstraintsAsync(IDbConnection db, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the provider supports default constraints.
GetDotnetTypeFromSqlType ​
Gets the .NET type descriptor from the SQL type.
void GetDotnetTypeFromSqlType(string sqlType)
Parameters ​
- sqlType (string) - The SQL type.
Returns ​
The .NET type descriptor.
GetSqlTypeFromDotnetType ​
Gets the SQL type from the .NET type descriptor.
void GetSqlTypeFromDotnetType(DotnetTypeDescriptor descriptor)
Parameters ​
- descriptor (DotnetTypeDescriptor) - The .NET type descriptor.
Returns ​
The SQL type.
GetSchemaQualifiedIdentifierName ​
Gets the schema-qualified identifier name.
void GetSchemaQualifiedIdentifierName(string schemaName, string tableName)
Parameters ​
- schemaName (string) - The schema name.
- tableName (string) - The table name.
Returns ​
The schema-qualified identifier name.
DoesDefaultConstraintExistAsync ​
Checks if a default constraint exists in the database.
void 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 ​
True if the constraint exists, otherwise false.
DoesDefaultConstraintExistOnColumnAsync ​
Checks if a default constraint exists on a specific column in the database.
void 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 ​
True if the constraint exists, otherwise false.
CreateDefaultConstraintIfNotExistsAsync ​
Creates a default constraint if it does not exist.
void 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 ​
True if the constraint was created, otherwise false.
GetDefaultConstraintAsync ​
Gets a default constraint from the database.
void 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 ​
The default constraint if found, otherwise null.
GetDefaultConstraintNameOnColumnAsync ​
Gets the name of the default constraint on a specific column.
void 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 ​
The name of the default constraint if found, otherwise null.
GetDefaultConstraintNamesAsync ​
Gets the names of all default constraints in the database.
void 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 ​
A list of default constraint names.
GetDefaultConstraintOnColumnAsync ​
Gets the default constraint on a specific column.
void 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 ​
The default constraint if found, otherwise null.
GetDefaultConstraintsAsync ​
Gets all default constraints in the database.
void 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 ​
A list of default constraints.
DoesForeignKeyConstraintExistAsync ​
Checks if a foreign key constraint exists.
void 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 ​
True if the constraint exists, otherwise false.
DoesForeignKeyConstraintExistOnColumnAsync ​
Checks if a foreign key constraint exists on a specific column.
void 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 ​
True if the constraint exists on the column, otherwise false.
CreateForeignKeyConstraintIfNotExistsAsync ​
Creates a foreign key constraint if it does not exist.
void 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 ​
True if the constraint was created, otherwise false.
GetForeignKeyConstraintAsync ​
Gets a foreign key constraint.
void 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 ​
The foreign key constraint if found, otherwise null.
GetForeignKeyConstraintNameOnColumnAsync ​
Gets the name of the foreign key constraint on a specific column.
void 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 ​
The name of the foreign key constraint if found, otherwise null.
GetForeignKeyConstraintNamesAsync ​
Gets the names of the foreign key constraints.
void 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 ​
A list of foreign key constraint names.
GetForeignKeyConstraintOnColumnAsync ​
Gets the foreign key constraint on a specific column.
void 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 ​
The foreign key constraint if found, otherwise null.
GetForeignKeyConstraintsAsync ​
Gets the foreign key constraints.
void 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 ​
A list of foreign key constraints.
DropForeignKeyConstraintOnColumnIfExistsAsync ​
Drops the foreign key constraint on a specific column if it exists.
void 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 ​
True if the constraint was dropped, otherwise false.
DoesIndexExistAsync ​
Checks if an index exists in the database.
void 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 ​
True if the index exists, otherwise false.
DoesIndexExistOnColumnAsync ​
Checks if an index exists on a specific column in the database.
void 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 ​
True if the index exists on the column, otherwise false.
CreateIndexIfNotExistsAsync ​
Creates an index if it does not already exist.
void CreateIndexIfNotExistsAsync(IDbConnection db, DmIndex index, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- index (DmIndex) - The index details.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the index was created, otherwise false.
CreateIndexIfNotExistsAsync ​
Creates an index if it does not already exist.
void CreateIndexIfNotExistsAsync(IDbConnection db, string schemaName, string tableName, string indexName, DmOrderedColumn[] columns, bool isUnique, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- indexName (string) - The index name.
- columns (DmOrderedColumn[]) - The columns to include in the index.
- isUnique (bool) - Whether the index is unique.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the index was created, otherwise false.
GetIndexAsync ​
Retrieves an index from the database.
void 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 ​
The index details, or null if the index does not exist.
GetIndexesAsync ​
Retrieves a list of indexes from the database.
void 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) - An optional filter for the index name.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of indexes.
GetIndexNamesOnColumnAsync ​
Retrieves a list of index names on a specific column from the database.
void 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 ​
A list of index names.
GetIndexNamesAsync ​
Retrieves a list of index names from the database.
void 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) - An optional filter for the index name.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of index names.
GetIndexesOnColumnAsync ​
Retrieves a list of indexes on a specific column from the database.
void 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 ​
A list of indexes.
DropIndexIfExistsAsync ​
Drops an index if it exists in the database.
void 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 ​
True if the index was dropped, otherwise false.
DropIndexesOnColumnIfExistsAsync ​
Drops indexes on a specific column if they exist in the database.
void 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 ​
True if any indexes were dropped, otherwise false.
DoesPrimaryKeyConstraintExistAsync ​
Checks if a primary key constraint exists on the specified table.
void 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 ​
True if the primary key constraint exists, otherwise false.
CreatePrimaryKeyConstraintIfNotExistsAsync ​
Creates a primary key constraint if it does not already exist.
void CreatePrimaryKeyConstraintIfNotExistsAsync(IDbConnection db, DmPrimaryKeyConstraint constraint, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- constraint (DmPrimaryKeyConstraint) - The primary key constraint details.
- tx (IDbTransaction) - The transaction to use, or null.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the primary key constraint was created, otherwise false.
GetPrimaryKeyConstraintAsync ​
Gets the primary key constraint for the specified table.
void 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 ​
The primary key constraint, or null if it does not exist.
DoesSchemaExistAsync ​
Checks if a schema exists in the database.
void DoesSchemaExistAsync(IDbConnection db, string schemaName, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- schemaName (string) - The name of the schema.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the schema exists, otherwise false.
CreateSchemaIfNotExistsAsync ​
Creates a schema if it does not exist in the database.
void CreateSchemaIfNotExistsAsync(IDbConnection db, string schemaName, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- schemaName (string) - The name of the schema.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the schema was created, otherwise false.
GetSchemaNamesAsync ​
Retrieves the list of schema names from the database.
void 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 ​
A list of schema names.
DropSchemaIfExistsAsync ​
Drops a schema if it exists in the database.
void DropSchemaIfExistsAsync(IDbConnection db, string schemaName, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- schemaName (string) - The name of the schema.
- tx (IDbTransaction) - The database transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the schema was dropped, otherwise false.
DoesTableExistAsync ​
Checks if a table exists in the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the table exists, otherwise false.
CreateTablesIfNotExistsAsync ​
Creates tables if they do not exist.
void CreateTablesIfNotExistsAsync(IDbConnection db, DmTable[] tables, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- tables (DmTable[]) - The tables to create.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A task that represents the asynchronous operation.
CreateTableIfNotExistsAsync ​
Creates a table if it does not exist.
void CreateTableIfNotExistsAsync(IDbConnection db, DmTable table, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- table (DmTable) - The table to create.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the table was created, otherwise false.
CreateTableIfNotExistsAsync ​
Creates a table if it does not exist.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the table was created, otherwise false.
GetTableAsync ​
Gets a table from the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The table if found, otherwise null.
GetTableNamesAsync ​
Gets the names of tables in the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of table names.
DropTableIfExistsAsync ​
Drops a table if it exists.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the table was dropped, otherwise false.
RenameTableIfExistsAsync ​
Renames a table if it exists.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the table was renamed, otherwise false.
DoesUniqueConstraintExistAsync ​
Checks if a unique constraint exists in the specified table.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the unique constraint exists, otherwise false.
DoesUniqueConstraintExistOnColumnAsync ​
Checks if a unique constraint exists on the specified column.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the unique constraint exists on the column, otherwise false.
CreateUniqueConstraintIfNotExistsAsync ​
Creates a unique constraint if it does not already exist.
void CreateUniqueConstraintIfNotExistsAsync(IDbConnection db, DmUniqueConstraint constraint, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- constraint (DmUniqueConstraint) - The unique constraint to create.
- tx (IDbTransaction) - The transaction to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the unique constraint was created, otherwise false.
GetUniqueConstraintAsync ​
Gets a unique constraint by name.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The unique constraint if found, otherwise null.
GetUniqueConstraintNameOnColumnAsync ​
Gets the name of the unique constraint on the specified column.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The name of the unique constraint if found, otherwise null.
GetUniqueConstraintNamesAsync ​
Gets the names of all unique constraints in the specified table.
void 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) - An optional filter for constraint names.
- tx (IDbTransaction) - The transaction to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of unique constraint names.
GetUniqueConstraintOnColumnAsync ​
Gets the unique constraint on the specified column.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The unique constraint if found, otherwise null.
GetUniqueConstraintsAsync ​
Gets all unique constraints in the specified table.
void 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) - An optional filter for constraint names.
- tx (IDbTransaction) - The transaction to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of unique constraints.
DropUniqueConstraintOnColumnIfExistsAsync ​
Drops a unique constraint on the specified column if it exists.
void 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 to use.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the unique constraint was dropped, otherwise false.
DoesViewExistAsync ​
Checks if a view exists in the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the view exists, otherwise false.
CreateViewIfNotExistsAsync ​
Creates a view if it does not exist.
void CreateViewIfNotExistsAsync(IDbConnection db, DmView view, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- view (DmView) - The view details.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the view was created, otherwise false.
CreateViewIfNotExistsAsync ​
Creates a view if it does not exist.
void CreateViewIfNotExistsAsync(IDbConnection db, string schemaName, string viewName, string definition, IDbTransaction tx, CancellationToken cancellationToken)
Parameters ​
- db (IDbConnection) - The database connection.
- schemaName (string) - The schema name.
- viewName (string) - The view name.
- definition (string) - The view definition.
- tx (IDbTransaction) - The transaction.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the view was created, otherwise false.
GetViewAsync ​
Gets a view from the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
The view details, or null if the view does not exist.
GetViewNamesAsync ​
Gets the names of views from the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of view names.
GetViewsAsync ​
Gets views from the database.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
A list of views.
DropViewIfExistsAsync ​
Drops a view if it exists.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the view was dropped, otherwise false.
RenameViewIfExistsAsync ​
Renames a view if it exists.
void 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.
- cancellationToken (CancellationToken) - The cancellation token.
Returns ​
True if the view was renamed, otherwise false.
GetType ​
void GetType()
ToString ​
void ToString()
Equals ​
void Equals()
GetHashCode ​
void GetHashCode()
Properties ​
QuoteChars ​
Type: char[]
ProviderType ​
Type: object
ProviderTypeMap ​
Type: object
SupportsSchemas ​
Gets a value indicating whether the provider supports schemas.
Type: object