public function executeKeyspaceIds(Context $ctx, $query, $keyspace, array $keyspace_ids, array $bind_vars, $tablet_type) { $request = new Proto\Vtgate\ExecuteKeyspaceIdsRequest(); $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars)); $request->setTabletType($tablet_type); $request->setKeyspace($keyspace); $request->setKeyspaceIds($keyspace_ids); if ($ctx->getCallerId()) { $request->setCallerId($ctx->getCallerId()); } $response = $this->client->executeKeyspaceIds($ctx, $request); ProtoUtils::checkError($response); return new Cursor($response->getResult()); }
public function executeKeyspaceIds(Context $ctx, $query, $keyspace, array $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\ExecuteKeyspaceIdsRequest(); $request->setSession($this->session); $request->setQuery(ProtoUtils::BoundQuery($query, $bind_vars)); $request->setTabletType($tablet_type); $request->setKeyspace($keyspace); $request->setKeyspaceIds($keyspace_ids); if ($ctx->getCallerId()) { $request->setCallerId($ctx->getCallerId()); } $response = $this->client->executeKeyspaceIds($ctx, $request); $this->session = $response->getSession(); ProtoUtils::checkError($response); return new Cursor($response->getResult()); }