Пример #1
0
 public function executeEntityIds(Context $ctx, $query, $keyspace, $entity_column_name, array $entity_keyspace_ids, array $bind_vars, $tablet_type)
 {
     $request = new Proto\Vtgate\ExecuteEntityIdsRequest();
     $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setKeyspace($keyspace);
     $request->setEntityColumnName($entity_column_name);
     ProtoUtils::addEntityKeyspaceIds($request, $entity_keyspace_ids);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeEntityIds($ctx, $request);
     ProtoUtils::checkError($response);
     return new Cursor($response->getResult());
 }
Пример #2
0
 public function executeEntityIds(Context $ctx, $query, $keyspace, $entity_column_name, array $entity_keyspace_ids, 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\ExecuteEntityIdsRequest();
     $request->setSession($this->session);
     $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setKeyspace($keyspace);
     $request->setEntityColumnName($entity_column_name);
     ProtoUtils::addEntityKeyspaceIds($request, $entity_keyspace_ids);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeEntityIds($ctx, $request);
     $this->session = $response->getSession();
     ProtoUtils::checkError($response);
     return new Cursor($response->getResult());
 }