1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

Translator: improved Expression usage

This commit is contained in:
David Grudl
2018-04-06 02:56:22 +02:00
parent ccc035c8fb
commit cf0129a194
2 changed files with 17 additions and 1 deletions

View File

@@ -507,6 +507,18 @@ Assert::same(
);
Assert::same(
reformat('SELECT * FROM [table] WHERE (([left] = 1) OR ([top] = 2)) AND (number < 100)'),
$conn->translate('SELECT * FROM `table` WHERE %and', [
new Dibi\Expression('%or', [
'left' => 1,
'top' => 2,
]),
new Dibi\Expression('number < %i', 100),
])
);
$e = Assert::exception(function () use ($conn) {
$array6 = [
'id' => [1, 2, 3, 4],