storage
storage copied to clipboard
[Feat] Allow reuse of an existing db connection when creating a MySQL storage driver
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.
- [x] please add a test case for your adjustment
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!..