the update() and insert() constructs support this but this usage isn't integrated in the ORM (and would seem like a pretty low priority feature in any case).
On Sep 12, 2013, at 1:45 PM, Jonathan Vanasco <[email protected]> wrote: > Actually, this is more correct for multi-key updates: > > -- select before update > SELECT id, kv->'x' AS kv_x , kv->'y' AS kv_y , kv->'z' AS kv_z FROM > test_class ; > > -- update 2 columns ; these 3 are identical > ---- kvkv > UPDATE test_class SET kv = kv || hstore(ARRAY['z','zz','x','xx']); > ---- kv,kv > UPDATE test_class SET kv = kv || hstore(ARRAY[['z','zz'],['x','xx']]); > ---- kk , vv > UPDATE test_class SET kv = kv || > hstore(ARRAY['z','x'],ARRAY['zz','xx']); > > -- confirm update > SELECT id, kv->'x' AS kv_x , kv->'y' AS kv_y , kv->'z' AS kv_z FROM > test_class ; > > The selector syntax annoyingly flips between `=>` for insert/operations and > `->` for reading. > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/groups/opt_out.
signature.asc
Description: Message signed with OpenPGP using GPGMail
