Updates are easy, too.
my ($sql, @sql_params) = UPDATE 'foo', SET(
op( 'bar', '=', 1 ),
op( 'baz', '=', 2 ),
WHERE match( 'qux', '=', 3 );
UPDATE takes a table to update, followed by
SET, we’re using the
op function, which is actually an alias for
match. Calling it
op is more readable here, since we’re not matching anything. Note that the data there is still handled as placeholders.
WHERE part works just like it does in