Class PostgreSqlDatabaseConnector
- Namespace
- LfrlAnvil.PostgreSql
- Assembly
- LfrlAnvil.PostgreSql.dll
Represents a DB connector.
public sealed class PostgreSqlDatabaseConnector : ISqlDatabaseConnector<NpgsqlConnection>, ISqlDatabaseConnector<DbConnection>, ISqlDatabaseConnector
- Inheritance
-
PostgreSqlDatabaseConnector
- Implements
-
ISqlDatabaseConnector<NpgsqlConnection>
- Inherited Members
Remarks
PostgreSqlDialect implementation.
Properties
Database
SqlDatabase instance that this connector belongs to.
public PostgreSqlDatabase Database { get; }
Property Value
Methods
Connect()
Connects to the database.
[Pure]
public NpgsqlConnection Connect()
Returns
- NpgsqlConnection
DbConnection instance that represents an established connection.
Connect(string)
Connects to the database.
[Pure]
public NpgsqlConnection Connect(string options)
Parameters
options
stringPartial connection string that can be used to modify how the connection gets established.
Returns
- NpgsqlConnection
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]
public ValueTask<NpgsqlConnection> 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<NpgsqlConnection>
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]
public ValueTask<NpgsqlConnection> ConnectAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenOptional CancellationToken instance.
Returns
- ValueTask<NpgsqlConnection>
A task that returns an DbConnection instance that represents an established connection.