-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect limit/offset from query builder in dbal query loader (#1492)
* Respect limit/offset from query builder in dbal query loader * updated dsl definitions
- Loading branch information
1 parent
168efb3
commit acf1376
Showing
8 changed files
with
217 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Context/SelectQueryCounter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\ETL\Adapter\Doctrine\Tests\Context; | ||
|
||
use Psr\Log\{AbstractLogger, LoggerAwareInterface, LoggerAwareTrait, NullLogger}; | ||
|
||
final class SelectQueryCounter extends AbstractLogger implements LoggerAwareInterface | ||
{ | ||
use LoggerAwareTrait; | ||
|
||
public int $count = 0; | ||
|
||
public array $queries = []; | ||
|
||
public function __construct() | ||
{ | ||
$this->logger = new NullLogger(); | ||
} | ||
|
||
public function log(mixed $level, string|\Stringable $message, array $context = []) : void | ||
{ | ||
if (!isset($context['sql'])) { | ||
return; | ||
} | ||
|
||
if (\str_starts_with(\trim((string) $context['sql']), 'SELECT')) { | ||
$this->count++; | ||
$this->queries[] = $context['sql']; | ||
} | ||
} | ||
|
||
public function reset() : void | ||
{ | ||
$this->count = 0; | ||
$this->queries = []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.