I was implementing insert or update operation when encountered an issue with upsert/update function.
When upserting foo::Foo I would expect to be able to do it like:
upsert tbl [foo]
Anyway, in current implementation it gets a bit more complicated due to the "update" function: (Row (Backend m) a -> Row (Backend m) a). Only way described in the docs is to use when :: Row s a -> [Assignment s a] -> Row s a. Unfortunately it requires list of assignments, when I have only full foo.
IMO, the best way will be to provide (or document if it exists) mystery_name:: a -> Row s a.
I was implementing insert or update operation when encountered an issue with
upsert
/update
function.When upserting
foo::Foo
I would expect to be able to do it like:Anyway, in current implementation it gets a bit more complicated due to the "update" function:
(Row (Backend m) a -> Row (Backend m) a)
. Only way described in the docs is to usewhen :: Row s a -> [Assignment s a] -> Row s a
. Unfortunately it requires list of assignments, when I have only fullfoo
.IMO, the best way will be to provide (or document if it exists)
mystery_name:: a -> Row s a
.