Table of Contents

Interface ISqlDatabaseConnector<TConnection>

Namespace
LfrlAnvil.Sql
Assembly
LfrlAnvil.Sql.Core.dll

Represents a DB connector.

public interface ISqlDatabaseConnector<TConnection> : ISqlDatabaseConnector where TConnection : DbConnection

Type Parameters

TConnection

DB connection type.

Properties

Database

SqlDatabase instance that this connector belongs to.

SqlDatabase Database { get; }

Property Value

SqlDatabase

Methods

Connect()

Connects to the database.

[Pure]
TConnection Connect()

Returns

TConnection

DbConnection instance that represents an established connection.

Connect(string)

Connects to the database.

[Pure]
TConnection Connect(string options)

Parameters

options string

Partial connection string that can be used to modify how the connection gets established.

Returns

TConnection

DbConnection instance that represents an established connection.

Remarks

Immutable connection string entries provided in options will be ignored.

ConnectAsync(string, CancellationToken)

Connects to the database asynchronously.

[Pure]
ValueTask<TConnection> ConnectAsync(string options, CancellationToken cancellationToken = default)

Parameters

options string

Partial connection string that can be used to modify how the connection gets established.

cancellationToken CancellationToken

Optional CancellationToken instance.

Returns

ValueTask<TConnection>

A task that returns an DbConnection instance that represents an established connection.

Remarks

Immutable connection string entries provided in options will be ignored.

ConnectAsync(CancellationToken)

Connects to the database asynchronously.

[Pure]
ValueTask<TConnection> ConnectAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken instance.

Returns

ValueTask<TConnection>

A task that returns an DbConnection instance that represents an established connection.