fromDataSource static method

Future<PostgresRevokeStore> fromDataSource(
  1. DataSource dataSource, {
  2. String namespace = 'stem',
  3. bool runMigrations = true,
})

Creates a revoke store using an existing DataSource.

The caller remains responsible for disposing the DataSource.

Implementation

static Future<PostgresRevokeStore> fromDataSource(
  DataSource dataSource, {
  String namespace = 'stem',
  bool runMigrations = true,
}) async {
  final resolvedNamespace = namespace.trim().isNotEmpty
      ? namespace.trim()
      : 'stem';
  final connections = await PostgresConnections.openWithDataSource(
    dataSource,
    runMigrations: runMigrations,
  );
  return PostgresRevokeStore._(connections, namespace: resolvedNamespace);
}