storage icon indicating copy to clipboard operation
storage copied to clipboard

[Feat] Allow reuse of an existing db connection when creating a MySQL storage driver

Open DGivney opened this issue 1 year ago • 2 comments

Support for passing an existing db connection was requested in this thread: https://github.com/gofiber/storage/issues/147

This pull request implements support for this feature in the MySQL storage driver, allowing the developer to optionally reuse their existing db connection to Get/Set session data.

It also updates the README removing references to postgres.

DGivney avatar Oct 10 '22 06:10 DGivney

  • [x] please add a test case for your adjustment

ReneWerner87 avatar Oct 10 '22 06:10 ReneWerner87

Hi Rene

There were no test cases for the existing functionality of the 'New' method so I wasn't sure what would be the best way to test this.

This test case creates the 3 different ways of returning a db connection in the interface (through authentication values or ConnectionURI or by passing an existing connection).

Let me know your thoughts!..

DGivney avatar Oct 10 '22 07:10 DGivney