Open marcinkuzminski opened 6 years ago
Previously it was actually an unexpected behaviour that any unsupported option for the DatabaseNamespaceManager
would just end up being proxied as SQLAlchemy option.
That lead as a side effect that options like sa.url
which was unsupported by the DatabaseNamespaceManager
ended up being proxied to SQLAlchemy and as they were prefixed exactly like the sqlalchemy option prefix they would replace the sqlalchemy options.
This was mostly by chance and is no longer supported because backends are now expected to just ignore options that they do not support. Which allows to better handle backend specific options in each backend.
The options for the DatabaseNamespaceManager
were originally expected as a dictionary in a sa_opts
option::
``sa_opts``
A dictionary of SQLAlchemy keyword options to initialize the engine
with.
I realise that this is less convenient as parsing of dict like options through an .ini
file is not viable, but we need a way to distinguish between sqlalchemy options and unsupported options and a more explicit way of providing sqlalchemy options instead of relying on what is mostly an undocumented internal detail.
Thanks for the explanation, I understand it was an undocumented feature, however i think this change will break a lot of applications, and furthermore, there's no alternative to use except to code it in the python implementations.
This was mostly by chance and is no longer supported because backends are now expected to just ignore options that they do not support. Which allows to better handle backend specific options in each backend.
So what does that fix, or what problem does it solve? For me the previous behavior was a good extension mechanism.
Like for us (RhodeCode) when we ship a bundled application it heavily uses beaker caching, and we have various settings based on customer requirements (mostly to handle mysql problems when using DB backends). It requires a lot of effort for us to turn it from .ini settings into python dict settings, and I believe this will also happen to others.
How about making only the ext:database backend use the .sa.* options while others don't? Or introduce maybe some reserved option to pass along values via .ini file, like pyramid_dogpile does.
dogpile_cache.REGION.arguments.*
This makes it more explicit.
After an upgrade to 1.10.0 from 1.9.1 we're getting an exception when using a DB backend for sessions.
Here's the session configuration we use: