Class RedbSqlConnectionFactory
The sql: data source redb: a step with dataSource=redb (the default redb service) or
dataSource=redb:orders (the named one) runs its statement on the connection that service works on for the
exchange, in the transaction redb's own commands run in. Inside .Transacted() the statement and every redb step
of the block commit or roll back together, on one connection, without a distributed transaction; outside a
transaction the statement runs in autocommit.
The service is the one the redb steps of the same exchange get (),
borrowed through IRedbConnection.LeaseAsync for the time of the statement and given back right after it.
public sealed class RedbSqlConnectionFactory : ISqlConnectionFactory
Inheritance
Implements
Properties
LendsConnection
True when lends a connection the endpoint does not own. The endpoint then begins no
public bool LendsConnection { get; }
Methods
CreateConnectionAsync(bool, CancellationToken)
Refused: the data source lends redb's connection per exchange and opens none of its own.
public Task<DbConnection> CreateConnectionAsync(bool readOnly = false, CancellationToken ct = default)
ForQualifier(string?)
The factory of the default service (no qualifier) or the named one (redb:orders). Throws when the service
public ISqlConnectionFactory ForQualifier(string? qualifier)
LeaseAsync(IExchange, bool, CancellationToken)
Borrows the connection of the exchange's redb service. readOnly is ignored: the statement runs
public Task<SqlConnectionLease> LeaseAsync(IExchange exchange, bool readOnly = false, CancellationToken ct = default)
Constructors
RedbSqlConnectionFactory(IRouteContext)
The factory of the default redb service on context.