mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 17:14:16 +02:00
Connection::update() Support updating multiple tables at once (#316)
This commit is contained in:
committed by
David Grudl
parent
95c424a71d
commit
168971292d
@@ -29,3 +29,15 @@ Assert::same(
|
||||
reformat('UPDATE IGNORE DELAYED [table] SET [title]=\'Super Product\', [price]=12, [brand]=NULL , [another]=123'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
|
||||
$arr = [
|
||||
'table1.title' => 'Super Product',
|
||||
'table2.price' => 12,
|
||||
'table2.brand' => null,
|
||||
];
|
||||
$fluent = $conn->update(['table1', 'table2'], $arr);
|
||||
Assert::same(
|
||||
reformat('UPDATE [table1], [table2] SET [table1].[title]=\'Super Product\', [table2].[price]=12, [table2].[brand]=NULL'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
Reference in New Issue
Block a user