MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / get_connections

Function get_connections

tortoise/connection.py:330–341  ·  view source on GitHub ↗

Get the ConnectionHandler from the current context. This is a convenience function. Prefer accessing connections directly via context: `ctx.connections` :raises ConfigurationError: If no context is active

()

Source from the content-addressed store, hash-verified

328
329
330def get_connections() -> ConnectionHandler:
331 """
332 Get the ConnectionHandler from the current context.
333
334 This is a convenience function. Prefer accessing connections directly
335 via context: `ctx.connections`
336
337 :raises ConfigurationError: If no context is active
338 """
339 from tortoise.context import require_context
340
341 return require_context().connections

Callers 14

_get_connectionFunction · 0.90
execute_pypikaFunction · 0.90
generate_schemasMethod · 0.90
_drop_databasesMethod · 0.90
init_ormFunction · 0.90
tortoise_initFunction · 0.90
init_ormFunction · 0.90
init_ormFunction · 0.90
init_ormMethod · 0.90
init_ormFunction · 0.90
__aenter__Method · 0.90
__aexit__Method · 0.90

Calls 1

require_contextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…