Parallel N1ql execution support?

It might be useful. Technically it is not complex, the problem is the API for that.

What do you think about this one?

$query1 = CouchbaseN1qlQuery::fromString('SELECT * FROM `travel-sample` WHERE type="airport"');
$query2 = CouchbaseN1qlQuery::fromString('SELECT * FROM `travel-sample` WHERE type="hotel"');

$multi = CouchbaseN1qlQuery::multi($query1, $query2);
$result = $multi->execute();

// printout airports
if ($result[0]->error == NULL) {
  for ($result[0]->rows as $row) {
    var_dump($row);
  }
}

Note that in this case it will not throw exceptions, but rather return them in error attribute of result.

1 Like