Skip to content

Commit 2f71e33

Browse files
committed
chore: name consistently
1 parent 12bf2ac commit 2f71e33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sqlspec/extensions/litestar/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ def get_config(
530530
msg = f"No database configuration found for name '{name}'. Available keys: {self._get_available_keys()}"
531531
raise KeyError(msg)
532532

533-
def _ensure_connection(self, plugin_state: PluginConfigState, state: "State", scope: "Scope") -> Any:
534-
"""Ensure a connection exists in scope, creating one from the pool if needed."""
533+
def _ensure_connection_sync(self, plugin_state: PluginConfigState, state: "State", scope: "Scope") -> Any:
534+
"""Ensure a connection exists in scope, creating one from the pool if needed (sync)."""
535535
connection = get_sqlspec_scope_state(scope, plugin_state.connection_key)
536536
if connection is not None:
537537
return connection
@@ -666,7 +666,7 @@ def provide_request_session_sync(
666666
A sync driver session instance for the specified database configuration.
667667
"""
668668
plugin_state = self._get_plugin_state(key)
669-
connection = self._ensure_connection(plugin_state, state, scope)
669+
connection = self._ensure_connection_sync(plugin_state, state, scope)
670670
return cast("SyncDriverAdapterBase", self._create_session(plugin_state, connection, scope))
671671

672672
@overload
@@ -801,7 +801,7 @@ def provide_request_connection_sync(
801801
A database connection instance for the specified database configuration.
802802
"""
803803
plugin_state = self._get_plugin_state(key)
804-
return self._ensure_connection(plugin_state, state, scope)
804+
return self._ensure_connection_sync(plugin_state, state, scope)
805805

806806
@overload
807807
async def provide_request_connection_async(

0 commit comments

Comments
 (0)