mirror of
https://github.com/dg/dibi.git
synced 2025-08-07 06:36:44 +02:00
Fluent: fixed combination of modifier and inner fluent [Closes #192]
This commit is contained in:
@@ -189,8 +189,7 @@ class Fluent implements IDataSource
|
||||
|
||||
foreach ($args as $arg) {
|
||||
if ($arg instanceof self) {
|
||||
$this->cursor[] = '%SQL';
|
||||
$arg = "($arg)";
|
||||
$arg = new Literal("($arg)");
|
||||
}
|
||||
$this->cursor[] = $arg;
|
||||
}
|
||||
|
@@ -151,3 +151,12 @@ Assert::same(
|
||||
reformat(' SELECT * LIMIT 1 OFFSET 1'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
|
||||
$fluent = $conn->select('*')->from('abc')
|
||||
->where('x IN (%SQL)', $conn->select('id')->from('xyz'));
|
||||
|
||||
Assert::same(
|
||||
reformat('SELECT * FROM [abc] WHERE x IN ((SELECT [id] FROM [xyz]))'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
Reference in New Issue
Block a user