Skip to content

IDatabaseMethods ​

Namespace: MJCZone.DapperMatic.Interfaces

Assembly: MJCZone.DapperMatic

Summary ​

Defines methods for interacting with a database.

Inheritance ​

Implemented Interfaces:

abstract public

Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.

Contents ​

Methods (5) | Properties (3)

Methods ​

SupportsCheckConstraintsAsync ​

Determines whether the database supports check constraints.

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

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

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

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

csharp
string GetSqlTypeFromDotnetType(DotnetTypeDescriptor descriptor)

Parameters ​

Returns ​

Type: string

The SQL type.

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