Closed nemesifier closed 10 years ago
here's what I've found + some questions, please send feedback.
HSTORE_GLOBAL_REGISTER
should be passed to the deferred registration case too, as done in: 1a5fb96HSTORE_REGISTER_GLOBALLY
which enables to pass globally=False
if neededHSTORE_GLOBAL_REGISTER
and HSTORE_REGISTER_GLOBALLY
have similar names though, which is really a bad ideaunique=False
?globally=False
?unique=True
and globally=False
breaks 20 tests (10 errors and 10 failures), while turning both globally
and unique
to False
works (all tests pass)HSTORE_REGISTER_GLOBALLY
by keeping backward compatibility with HSTORE_GLOBAL_REGISTER
unique=False
is that in each created connecion the register operation is executed.globally=False
, (which is a psycopg2 parameter) is that a register operation is only valid for the current connection.unique=True
and globally=False
makes that the register handler execute once and attached only for current connection. Obviously, the test fails are expected with this configuration.The sqlalchemy compatible settings is: unique=False
and globally=False
HSTORE_REGISTER_GLOBALLY
replace the HSTORE_GLOBAL_REGISTER
(obviously with backward compatibilities...)?On 06/23/2014 04:46 PM, Andrey Antukh wrote:
The sqlalchemy compatible settings is: |unique=False| and |globally=False|
- (7) You are proposing |HSTORE_REGISTER_GLOBALLY| replace the |HSTORE_GLOBAL_REGISTER| (obviously with backward compatibilities...)?
I ask the question in another way, does it have sense to have 2 separate settings to manage both parameters or should we only have one?
If we choose to have just 1 I propose to replace HSTORE_GLOBAL_REGISTER with HSTORE_REGISTER_GLOBALLYand mantain backward compatibility, if we choose to have 2 separate settings I propose to find better naming, also in this case mantaining backward compatibility
Thanks for all the other response, now i'm starting to understand more.
I propose to have DJANGO_HSTORE_REGISTER_TYPE = "global" or "connection"
When "global" means unique=True
and globally=True
, and "connection" means unique=False
and globally=False
That do you think about this approach?
Also, DJANGO_HSTORE_REGISTER_TYPE
can be also DJANGO_HSTORE_REGISTER_METHOD
How about DJANGO_HSTORE_ADAPTER_REGISTRATION
which defaults to "global" but can be switched to "connection"?
It's ok for me! Great name alternative ;)
done
@niwibe i'm ready to merge
Nice! Thanks!
Aims of this pull request is to start working on: