Closed guiscaranse closed 4 years ago
Thanks for the pull request. What would be the use case for allowing people to pass their own custom engine instead of supplying a set of arguments as a dict with engine_args, which is already possible?
Some event listeners require an engine object, you can't do that if you use this middleware because engine object get's stored inside of the middleware class. Example: https://docs.sqlalchemy.org/en/13/core/pooling.html#using-connection-pools-with-multiprocessing
EDIT: Just to be clear, this PR has more to do with being able to access the engine object instead of customizing it
Sounds good to me, merged it in.
This will allow users to pass a custom engine when in need to patch or customize the original engine class.