A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/cpp/docs/reference/spanner/2.14.0/classgoogle_1_1cloud_1_1spanner_1_1Row below:

Class Row (2.14.0) | C++ Client Libraries

Skip to main content Class Row (2.14.0)

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 aRow` of their own.

The number of columns in a Row can be obtained from the size() member function. The Values 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.

Example
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 &
Row(Row &&)

Copy and move.

Parameter Name Description Row &&
Row()

Default constructs an empty row with no columns nor values.

Operators operator=(Row const &)

Copy and move.

Parameter Name Description Row const &
Returns Type Description Row & operator=(Row &&)

Copy and move.

Parameter Name Description Row &&
Returns Type Description Row & Functions size() const

Returns the number of columns in the row.

Returns Type Description std::size_t columns() const

Returns the column names for the row.

Returns Type Description std::vector< std::string > const & values() const &

Returns the Value objects in the given row.

Returns Type Description std::vector< Value > const & values() &&

Returns the Value objects in the given row.

Returns Type Description std::vector< Value > && get(std::size_t) const

Returns the Value at the given pos.

Parameter Name Description pos std::size_t
Returns Type Description StatusOr< Value > get(std::string const &) const

Returns the Value in the column with name.

Parameter Name Description name std::string const &
Returns Type Description StatusOr< Value > get(Arg &&) const

Returns the native C++ value at the given position or column name.

Parameters Name Description arg 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 Description StatusOr< T > get() const &

Returns all the native C++ values for the whole row in a std::tuple with the specified type.

Parameter Name Description typename Tuple

the std::tuple type that the whole row must unpack into.

Returns Type Description StatusOr< Tuple > get() &&

Returns all the native C++ values for the whole row in a std::tuple with the specified type.

Parameter Name Description typename Tuple

the std::tuple type that the whole row must unpack into.

Returns Type Description 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 document outlines the `Row` class in the Google Cloud Spanner C++ client library, providing various versioned references for the class, starting from version `2.11.0` up to the latest `2.37.0-rc`."],["A `Row` is defined as a sequence of named columns, each associated with a `Value`, which can be large and should be copied only when necessary."],["`Row` instances are commonly obtained from Cloud Spanner table queries or reads via `Client::Read` and `Client::ExecuteQuery` methods, and users mainly use accessor methods rather than constructing their own `Row` objects."],["The `Row` class provides member functions such as `size()`, `columns()`, and `values()` to retrieve the number of columns, column names, and `Value` objects, respectively, while the `get()` method allows accessing a specific column's `Value` by its index or name."],["The `Row` class also provides access to get methods that allow extraction of the native C++ type, and the ability to return all native C++ values for the whole row in a std::tuple."]]],[]]


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