Currently, FreezeMessenger makes liberal use of MySQL's
INSERT-ON-DUPLICATE-KEY-UPDATE (aka upsert) functionality. This functionality
is not present in all MySQL databases (e.g. PostGreSQL) and would be very hard
to implement in non-SQL databases.
Instead, these type of queries should get their own function in the database
called upsert, accepting the params ($conditionArray, $dataArray), which would
do something like this:
if (!select($conditionArray)) {
insert($dataArray);
}
else update($conditionArray, $dataArray)
In databases with existing upsert functionality, this could instead be
performed as
INSERT $dataArray ON DUPLICATE KEY UPDATE unMerge($conditionArray, $dataArray)
This will require converting all existing insert() calls.
Original issue reported on code.google.com by JosephTP...@gmail.com on 31 Mar 2014 at 10:33
Original issue reported on code.google.com by
JosephTP...@gmail.com
on 31 Mar 2014 at 10:33