You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, out of habit and curiosity, I was messing around with the library when the following item caught my attention:
Why can't we use the default connection for _get_connection when we have multiple databases? 🤔
def _get_connection(connection_name: Optional[str]) -> "BaseDBAsyncClient":
if connection_name:
connection = connections.get(connection_name)
elif len(connections.db_config) == 1:
connection_name = next(iter(connections.db_config.keys()))
connection = connections.get(connection_name)
else:
raise ParamsError(
"You are running with multiple databases, so you should specify"
f" connection_name: {list(connections.db_config)}"
)
return connection
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Today, out of habit and curiosity, I was messing around with the library when the following item caught my attention:
Why can't we use the default connection for _get_connection when we have multiple databases? 🤔
Beta Was this translation helpful? Give feedback.
All reactions