gino
gino copied to clipboard
Make `reuse` configurable on init
Context:
This discussion topic has most (if not all) the context. It boils down to the following: When instantiating an instance of Gino via the API (when using something like gino-starlette) it'd be beneficial to be able to set the connection reuse behaviour explicitly for the connection pool. These changes achieves that whilst maintaining the functionality before the changes are applied.
Value: Make Gino more usable for this specific usecase, but add more flexibility in the functionality of the underlying package when using it via the API.
Changes:
- [X] add reuse as acceptable parameter on init in
api.py(e.g. when called usinggino.ext.starlette) - [X] add functionality to set
reuseflag inGinoEngineclass methods, passed to theGinoEngine.acquire()method - [X] add
reuseas accepted parameter inengine_argsinstrategies.py
Tests passing:
Tests passing in the as-is state. No new tests added as there are already tests in place to check the use of reuse flag.