gino icon indicating copy to clipboard operation
gino copied to clipboard

Make `reuse` configurable on init

Open coetzeevs opened this issue 4 years ago • 0 comments

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 using gino.ext.starlette)
  • [X] add functionality to set reuse flag in GinoEngine class methods, passed to the GinoEngine.acquire() method
  • [X] add reuse as accepted parameter in engine_args in strategies.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.

coetzeevs avatar Mar 17 '21 12:03 coetzeevs