withConnection method

OrmProjectConfig withConnection(
  1. String name
)

Returns a copy targeting the named connection.

Implementation

OrmProjectConfig withConnection(String name) {
  final normalized = name.trim();
  if (!_connections.containsKey(normalized)) {
    throw StateError('Connection $normalized is not defined.');
  }
  return OrmProjectConfig(
    connections: _connections,
    activeConnectionName: normalized,
    defaultConnectionName: defaultConnectionName,
  );
}