IDatabaseMethods
Namespace: MJCZone.DapperMatic.Interfaces
Assembly: MJCZone.DapperMatic
Summary
Defines methods for interacting with a database.
Inheritance
Implemented Interfaces:
- IDatabaseTableMethods
- IDatabaseColumnMethods
- IDatabaseIndexMethods
- IDatabaseCheckConstraintMethods
- IDatabaseDefaultConstraintMethods
- IDatabasePrimaryKeyConstraintMethods
- IDatabaseUniqueConstraintMethods
- IDatabaseForeignKeyConstraintMethods
- IDatabaseSchemaMethods
- IDatabaseViewMethods
abstract public
Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.
Contents
Methods (7) | Properties (3)
Methods
| Method | Summary |
|---|---|
| SupportsCheckConstraintsAsync | Determines whether the database supports check constraints. |
| SupportsOrderedKeysInConstraintsAsync | Determines whether the database supports ordered keys in constraints. |
| GetDatabaseVersionAsync | Gets the version of the database. |
| GetDotnetTypeFromSqlType | Gets the .NET type descriptor from the SQL type. |
| GetSqlTypeFromDotnetType | Gets the SQL type from the .NET type descriptor. |
| GetAvailableDataTypes | Gets the available data types for this database provider. |
| DiscoverCustomDataTypesAsync | Discovers custom data types from the database (e.g., user-defined types, domains, enums). |
SupportsCheckConstraintsAsync
Determines whether the database supports check constraints.
Task<bool> 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<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating support for check constraints.
SupportsOrderedKeysInConstraintsAsync
Determines whether the database supports ordered keys in constraints.
Task<bool> 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<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating support for ordered keys in constraints.
GetDatabaseVersionAsync
Gets the version of the database.
Task<Version> GetDatabaseVersionAsync(
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<Version>
A task that represents the asynchronous operation. The task result contains the database version.
GetDotnetTypeFromSqlType
Gets the .NET type descriptor from the SQL type.
DotnetTypeDescriptor GetDotnetTypeFromSqlType(string sqlType)Parameters
- sqlType (string) - The SQL type.
Returns
Type: DotnetTypeDescriptor
The .NET type descriptor.
GetSqlTypeFromDotnetType
Gets the SQL type from the .NET type descriptor.
string GetSqlTypeFromDotnetType(DotnetTypeDescriptor descriptor)Parameters
- descriptor (DotnetTypeDescriptor) - The .NET type descriptor.
Returns
Type: string
The SQL type.
GetAvailableDataTypes
Gets the available data types for this database provider.
IEnumerable<DataTypeInfo> GetAvailableDataTypes(bool includeAdvanced)Parameters
- includeAdvanced (bool) - If true, includes advanced/specialized types; otherwise, only common types.
Returns
Type: IEnumerable<DataTypeInfo>
A collection of available data types.
DiscoverCustomDataTypesAsync
Discovers custom data types from the database (e.g., user-defined types, domains, enums).
Task<IEnumerable<DataTypeInfo>> DiscoverCustomDataTypesAsync(
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<IEnumerable<DataTypeInfo>>
A task that represents the asynchronous operation. The task result contains custom data types.
Properties
ProviderType
Gets the type of the database provider.
Type: DbProviderType
ProviderTypeMap
Gets the provider type map.
Type: IDbProviderTypeMap
SupportsSchemas
Gets a value indicating whether the database supports schemas.
Type: bool