MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / connections

Method connections

tortoise/context.py:162–175  ·  view source on GitHub ↗

Get the ConnectionHandler for this context. Creates a new ConnectionHandler on first access (lazy initialization). The handler uses instance-level storage for true isolation between contexts. Returns: The ConnectionHandler instance owned by this context

(self)

Source from the content-addressed store, hash-verified

160
161 @property
162 def connections(self) -> ConnectionHandler:
163 """
164 Get the ConnectionHandler for this context.
165
166 Creates a new ConnectionHandler on first access (lazy initialization).
167 The handler uses instance-level storage for true isolation between contexts.
168
169 Returns:
170 The ConnectionHandler instance owned by this context.
171 """
172 if self._connections is None:
173 # ConnectionHandler always uses instance storage for isolation
174 self._connections = ConnectionHandler()
175 return self._connections
176
177 @property
178 def apps(self) -> Apps | None:

Callers

nothing calls this directly

Calls 1

ConnectionHandlerClass · 0.90

Tested by

no test coverage detected