Library reference docs
Namespaces
google::cloud::spanner
Classes
Client
Functions
DatabaseAdminClient
Functions
LimitedErrorCountTransactionRerunPolicy
LimitedTimeTransactionRerunPolicy
Structs
Functions
Operators
google::cloud::spanner_admin
Classes
DatabaseAdminClient
Functions
DatabaseAdminConnectionIdempotencyPolicy
DatabaseAdminLimitedErrorCountRetryPolicy
DatabaseAdminLimitedTimeRetryPolicy
InstanceAdminClient
Functions
InstanceAdminConnectionIdempotencyPolicy
InstanceAdminLimitedErrorCountRetryPolicy
InstanceAdminLimitedTimeRetryPolicy
Structs
google::cloud::spanner_admin_mocks
Stay organized with collections Save and categorize content based on your preferences.
A Row
is a sequence of columns each with a name and an associated Value
.
The Row
class is a regular value type that may be copied, moved, assigned, compared for equality, etc. Instances may be large if they hold lots of Value
data, so copy only when necessary.
Row
instances are typically returned as the result of queries or reads of a Cloud Spanner table (see Client::Read
and Client::ExecuteQuery
). Users will mostly just use the accessor methods on Row
, and will rarely (if ever) need to construct a
Row` of their own.
The number of columns in a Row
can be obtained from the size()
member function. The Value
s can be obtained using the values()
accessor. The names of each column in the row can be obtained using the columns()
accessor.
Perhaps the most convenient way to access the Values
in a row is through the variety of "get" accessors. A user may access a column's Value
by calling get
with a std::size_t
0-indexed position, or a std::string
column name. Furthermore, callers may directly extract the native C++ type by specifying the C++ type along with the column's position or name.
Row row = ...;
if (StatusOr<std::string> x = row.get<std::string>("LastName")) {
std::cout << "LastName=" << *x << "\n";
}
Constructors Row(Row const &)
Copy and move.
Parameter Name Description
Row const &
Copy and move.
Parameter Name Description
Row &&
Default constructs an empty row with no columns nor values.
Operators operator=(Row const &)Copy and move.
Parameter Name Description
Row const &
Row &
operator=(Row &&)
Copy and move.
Parameter Name Description
Row &&
Row &
Functions size() const
Returns the number of columns in the row.
Returns Type Descriptionstd::size_t
columns() const
Returns the column names for the row.
Returns Type Descriptionstd::vector< std::string > const &
values() const &
Returns the Value
objects in the given row.
std::vector< Value > const &
values() &&
Returns the Value
objects in the given row.
std::vector< Value > &&
get(std::size_t) const
Returns the Value
at the given pos
.
pos
std::size_t
StatusOr< Value >
get(std::string const &) const
Returns the Value
in the column with name
.
name
std::string const &
StatusOr< Value >
get(Arg &&) const
Returns the native C++ value at the given position or column name.
Parameters Name Descriptionarg
Arg &&
typename T
the native C++ type, e.g., std::int64_t or std::string
typename Arg
a deduced parameter convertible to a std::size_t or std::string
Returns Type DescriptionStatusOr< T >
get() const &
Returns all the native C++ values for the whole row in a std::tuple
with the specified type.
typename Tuple
the std::tuple
type that the whole row must unpack into.
StatusOr< Tuple >
get() &&
Returns all the native C++ values for the whole row in a std::tuple
with the specified type.
typename Tuple
the std::tuple
type that the whole row must unpack into.
StatusOr< Tuple >
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["This documentation details the `Row` class in the Google Cloud Spanner C++ client library, covering versions from 2.11.0 up to 2.37.0-rc, with the latest release at 2.37.0-rc."],["A `Row` object represents a sequence of named columns, each associated with a `Value`, and can be obtained from Spanner table queries or reads using `Client::Read` or `Client::ExecuteQuery`."],["Users can access the `Value` objects within a `Row` using methods like `values()`, `get(std::size_t)`, or `get(std::string const &)`, or by retrieving native C++ types directly through `get()`."],["The class provides functions to determine row size with `size()`, retrieve column names via `columns()`, and manage `Value` objects through various `values()` overloads, while also allowing for default construction, copying, moving, and assignment."],["`Row` object should be copied only when necessary, since large amounts of `Value` data can potentially be stored within an instance."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4