This is follow-up from attending Conf42 (Chaos Engineering) in London this week.
Is there a use case for our db abstraction layer allowing $db->update() without any conditions? In other words to submit a query like UPDATE some_table SET x=y that will indescriminately substitute an entire column with a particular column.
While I can think of hypothetical edge cases (e.g where y is not a hardcoded value but something dynamic like z + 1), perhaps they are rare enough to require bypassing update() for (in favour of query()).
In addition, there is also the performance and replication-safe aspect. Not having conditions also implies not having a limit or determinstic outcome, which means it is subject to race conditions and cannot be safely replicated to other databases. Our general practice is that, even if we do want to change an entire table, to select its primary key and then do the update in batches, which means at the very least there would be a WHERE condition for _id IN (,,,,,,).