Table of Contents

Interface ISqlDatabaseConnector

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

Represents a DB connector.

public interface ISqlDatabaseConnector

Properties

Database

ISqlDatabase instance that this connector belongs to.

ISqlDatabase Database { get; }

Property Value

ISqlDatabase

Methods

Connect()

Connects to the database.

[Pure]
IDbConnection Connect()

Returns

IDbConnection

IDbConnection instance that represents an established connection.

Connect(string)

Connects to the database.

[Pure]
IDbConnection Connect(string options)

Parameters

options string

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

Returns

IDbConnection

IDbConnection 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<IDbConnection> 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<IDbConnection>

A task that returns an IDbConnection 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<IDbConnection> ConnectAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken instance.

Returns

ValueTask<IDbConnection>

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