connection method

DatabaseConnection connection([
  1. String? name
])

Gets the current connection.

Implementation

DatabaseConnection connection([String? name]) {
  name ??= _config.get('database.default', 'mysql');

  if (!_connections.containsKey(name)) {
    _connections[name!] = _resolveConnection(name);
  }

  return _connections[name]!;
}