Skip to main content

apply_to_engines

FunctionPrivateSource

apply_to_engines(
func: Callable[[sa.engine.Engine], None],
bind_key: str | None | Sequence[str | None],
engines: Mapping[str, sa.engine.Engine],
default_engine: sa.engine.Engine,
)

Apply a function to one or multiple engines.

The given func is a function designed to be applied to a single engine. This method defines the logics of how to apply func to multiple engines.

Arguments

Requires

ArgumentTypeRequired
Description
func(sa.engine.Engine) -> NoneThe function to be applied to a single engine.
bind_keystr | None | Sequence[str | None]The name(s) of the engines where the func will be applied to.
enginesMapping[str, sa.engine.Engine]The collection of all registered engines. If bind_key is __all__, will apply func to all engines in this list.
default_enginesa.engine.EngineThe default engine. It should be the same as engines["default"].