-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
I think, at least.
Basically, what I want to do is: update foo set bar = bar || 'baz=>bam' where id=1 to add the baz=>bam keyword to the hstore entry. It looks like I'm stuck with update foo set bar = $1 and $1 binding to 'bar || "baz=>bam", which errors out (parse error coming back from postgres). I haven't completely isolated the error, but I'm 90% sure it's because the column name shouldn't be inside quotes there.
IOW: Knex.DB('foos').update('hstore_col', 'hstore_col || '+hstore.stringify(hstore_obj)) doesn't really do what I want.
This isn't a real huge blocker - most (maybe even all) of the time when I'm writing an hstore column to the database, I've already loaded it from the database, so I probably don't really need to worry about the situation where I set one key->value and accidentally delete all the other keys in the column. That said, it's definitely a gotcha in my ORM code.