コード例 #1
0
ファイル: VTGateConn.php プロジェクト: Rastusik/vitess
 public function executeKeyRanges(Context $ctx, $query, $keyspace, array $key_ranges, array $bind_vars, $tablet_type)
 {
     $request = new Proto\Vtgate\ExecuteKeyRangesRequest();
     $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setKeyspace($keyspace);
     ProtoUtils::addKeyRanges($request, $key_ranges);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeKeyRanges($ctx, $request);
     ProtoUtils::checkError($response);
     return new Cursor($response->getResult());
 }
コード例 #2
0
ファイル: VTGateTx.php プロジェクト: bsaideepak/vitess
 public function executeKeyRanges(Context $ctx, $query, $keyspace, array $key_ranges, array $bind_vars, $tablet_type = Proto\Topodata\TabletType::MASTER)
 {
     if (!$this->inTransaction()) {
         throw new \Vitess\Exception('execute called while not in transaction.');
     }
     $request = new Proto\Vtgate\ExecuteKeyRangesRequest();
     $request->setSession($this->session);
     $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setKeyspace($keyspace);
     ProtoUtils::addKeyRanges($request, $key_ranges);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeKeyRanges($ctx, $request);
     $this->session = $response->getSession();
     ProtoUtils::checkError($response);
     return new Cursor($response->getResult());
 }