For convenience, callers may wrap instances in a StreamOf<std::tuple<...>> object, which will automatically parse each Row into a std::tuple with the specified types.
Example:
namespace spanner = ::google::cloud::spanner;
spanner::SqlStatement select(
"SELECT AlbumId, AlbumTitle, MarketingBudget"
" FROM Albums"
" WHERE AlbumTitle >= 'Aardvark' AND AlbumTitle < 'Goo'");
auto profile_query_result = client.ProfileQuery(std::move(select));
for (auto& row : profile_query_result) {
if (!row) throw std::move(row).status();
// Discard rows for brevity in this example.
}
// Stats are only available after all rows from the result have been read.
auto execution_stats = profile_query_result.ExecutionStats();
if (execution_stats) {
for (auto const& stat : *execution_stats) {
std::cout << stat.first << ":\t" << stat.second << "\n";
}
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-22 UTC."],[[["\u003cp\u003eThis webpage details the \u003ccode\u003eProfileQueryResult\u003c/code\u003e class within the Google Cloud Spanner C++ library, showcasing the class's role in handling the stream of rows and profile statistics resulting from a \u003ccode\u003espanner::Client::ProfileQuery()\u003c/code\u003e call.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eProfileQueryResult\u003c/code\u003e class allows iteration through a sequence of \u003ccode\u003eStatusOr<Row>\u003c/code\u003e objects, and it can be wrapped in a \u003ccode\u003eStreamOf<std::tuple<...>>\u003c/code\u003e object for streamlined parsing into \u003ccode\u003estd::tuple\u003c/code\u003e types.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers methods like \u003ccode\u003ebegin()\u003c/code\u003e and \u003ccode\u003eend()\u003c/code\u003e to define the range of the result set, with \u003ccode\u003eRowStreamIterator\u003c/code\u003e instances controlling the iteration process.\u003c/p\u003e\n"],["\u003cp\u003eIt provides functions to access metadata like the \u003ccode\u003eReadTimestamp()\u003c/code\u003e, \u003ccode\u003eExecutionStats()\u003c/code\u003e, and \u003ccode\u003eExecutionPlan()\u003c/code\u003e, all of which provide valuable insight into the query's execution.\u003c/p\u003e\n"],["\u003cp\u003eThe page gives a list of versions of this \u003ccode\u003eProfileQueryResult\u003c/code\u003e and corresponding documentation starting from \u003ccode\u003e2.37.0-rc\u003c/code\u003e to \u003ccode\u003e2.11.0\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]