HSTORE docs fix
(original reporter: jonathan) The HSTORE docs are confusing:
For usage with the SQLAlchemy ORM, it may be desirable to combine the usage of HSTORE withMutableDict dictionary now part of the sqlalchemy.ext.mutable extension. This extension will allow in-place changes to dictionary values to be detected by the unit of work:
It's not really "desirable" -- it's pretty much required for most write operations. ;)
The wording states this is needed for "changes to dictionary values". That's misleading -- as it suggests a change to an existing key/value pair. The extension is required for any changes to the dictionary itself -- be updating a k/v pair or adding a k/v pair. You can only replace the entire attribute with a new dict in order to update without the MutableDict extension.
If you add a new k/v pair, inspecting the attribute shows a new value for the k/v, however the SQL is not emmitted unless the MutableDict extension is activated for the column.
It makes perfect sense what is going on and why. The docs should just be changed to something like...
- This extension will allow in-place changes to dictionary values to be detected by the unit of work:
+ This extension will allow changes to the attribute's dictionary to be detected by the unit of work:
or
- This extension will allow in-place changes to dictionary values to be detected by the unit of work:
+ This extension will allow changes to an existing dictionary ( such as adding a new key/value pair or updating an existing one) to be detected by the unit of work:
Comments (3)
-
repo owner -
repo owner - changed status to resolved
I did my best here, the term "in-place" is meaningful so I left that in, tried to introduce the word "event" so that the reader gets the idea that this has to do with events. I can't prevent every user from not understanding, though.
bb6df3f45f0d06e0b364ea06cb9e17c04513e192 0.8
71e043aaae1ff9cbf0597846b4 master
-
repo owner - removed milestone
Removing milestone: 0.8.xx (automated comment)
- Log in to comment