Interface ISqlDatabaseConnector<TConnection>
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
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
stringPartial 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
stringPartial connection string that can be used to modify how the connection gets established.
cancellationToken
CancellationTokenOptional 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
CancellationTokenOptional CancellationToken instance.
Returns
- ValueTask<TConnection>
A task that returns an DbConnection instance that represents an established connection.