storage
storage copied to clipboard
[Feature Request] Ability to pass in or retrieve database connections to/from storage structures
Like the title suggests, I believe the should be a able to either pass in a database connection to session storage structures or be able to be able to retrieve them for other non session specific database operations as opposed to having 2 separate/different sql drivers and connections (1 for sessions and 1 for other db stuff)
@Technerder so you propose that you could pass a db (connection) interface instead of the config to the storage middleware and then later on also be able to retrieve it?
Sounds like a good idea, might start working on a PR pretty soon.
Yeah, working on something like this here https://github.com/gofiber/storage/pull/153
https://github.com/gofiber/storage/pull/153/files#diff-a537808f48341a30aa18ae06a27a21209fa58e4f2a0247dfb933edecce97a12eR13
i see, perhaps i should follow the same sort of design philosophy with the other storage interfaces with a v2 subfolder on the other ones.
@Technerder I think this is fixed by #451
This is now supported by calling:
store.Conn() // returns pointer to DB connection used by the store