getProvider static method
FutureOr<DBConnectionProvider<DBConnection> ?>
getProvider(
- String type,
- DBConnectionCredential credential, {
- Duration retryInterval = const Duration(seconds: 1),
- int maxRetries = 10,
- int maxConnections = 1,
Gets a DBConnectionProvider for type
with credential
.
Implementation
static FutureOr<DBConnectionProvider?> getProvider(
String type, DBConnectionCredential credential,
{Duration retryInterval = const Duration(seconds: 1),
int maxRetries = 10,
int maxConnections = 1}) {
type = type.toLowerCase().trim();
var providerInstantiator = _registeredProviders[type];
if (providerInstantiator == null) return null;
var provider = providerInstantiator(credential,
retryInterval: retryInterval,
maxRetries: maxRetries,
maxConnections: maxConnections);
return provider;
}