1
0
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:
Dalibor Korpar
2018-09-17 10:39:23 +00:00
committed by David Grudl
parent 95c424a71d
commit 168971292d
3 changed files with 17 additions and 2 deletions

View File

@@ -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
);