alexedwards / scs

HTTP Session Management for Go
MIT License
2.12k stars 165 forks source link

creating method to change session's table default name #177

Closed 0syntrax0 closed 11 months ago

0syntrax0 commented 1 year ago

Some of us already have a sessions table that is used in a different way, just adding a method to use a different table.

Also useful when testing or comparing libraries and results.

alexedwards commented 11 months ago

I like this idea, and agree that supporting a custom name for the sessions table would be nice.

I don't think this PR works as-is --- it only implements the behavior on the pgxstore package, and I also don't really want to change the definition of the Store interface (which would be a breaking change).

I've opened issue https://github.com/alexedwards/scs/issues/180 to consider the options further.

gregwebs commented 11 months ago

I also don't really want to change the definition of the Store interface (which would be a breaking change).

Is this riffing on future designs? Because this PR doesn't change the Store interface. It looks like there was a mistake made in the change to the README. This PR changes the PostgresStore struct by adding a field, which is considered backwards compatible.

When a better design comes through that does work for all backends (I don't know what that would be if you don't want to change the interface), this change is still going to be needed. At best closing this PR would help to maintain more similar conventions across backends when implementing across all backends. So you can consider thoughtfully reviewing the conventions and merging this change now.