Skip to content

Commit

Permalink
added ability to use named keys in async queries
Browse files Browse the repository at this point in the history
  • Loading branch information
ay committed Jun 20, 2017
1 parent 65ef76e commit 18ccec0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Integrations/Laravel/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,17 @@ public function select($query, $bindings = [], $tables = [])
public function selectAsync(array $queries)
{
$results = $this->getClient()->selectAsync($queries);
$queriesKeys = array_keys($queries);

foreach ($results as $i => $result) {
/* @var \Tinderbox\Clickhouse\Query\Result $result */

list($query, $bindings) = $queries[$i];
$query = $queries[$queriesKeys[$i]][0];
$bindings = $queries[$queriesKeys[$i]][1] ?? [];

$this->logQuery($query, $bindings, $result->getStatistic()->getTime());

$results[$i] = $result->getRows();
$results[$queriesKeys[$i]] = $result->getRows();
}

return $results;
Expand Down

0 comments on commit 18ccec0

Please sign in to comment.