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
Argument | Type | Required | |
---|---|---|---|
func | (sa.engine.Engine) -> None | The function to be applied to a single engine. | |
bind_key | str | None | Sequence[str | None] | The name(s) of the engines where the func will be applied to. | |
engines | Mapping[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_engine | sa.engine.Engine | The default engine. It should be the same as engines["default"] . |