Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
read_options.h
Go to the documentation of this file.
1 // Copyright 2019 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_OPTIONS_H
17 
19 #include <google/spanner/v1/spanner.pb.h>
20 #include <string>
21 
22 namespace google {
23 namespace cloud {
24 namespace spanner {
25 inline namespace SPANNER_CLIENT_NS {
26 
28 struct ReadOptions {
34  std::string index_name;
35 
40  std::int64_t limit = 0;
41 };
42 
43 inline bool operator==(ReadOptions const& lhs, ReadOptions const& rhs) {
44  return lhs.limit == rhs.limit && lhs.index_name == rhs.index_name;
45 }
46 
47 inline bool operator!=(ReadOptions const& lhs, ReadOptions const& rhs) {
48  return !(lhs == rhs);
49 }
50 
51 } // namespace SPANNER_CLIENT_NS
52 } // namespace spanner
53 } // namespace cloud
54 } // namespace google
55 
56 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_OPTIONS_H
bool operator==(ReadOptions const &lhs, ReadOptions const &rhs)
Definition: read_options.h:43
bool operator!=(ReadOptions const &lhs, ReadOptions const &rhs)
Definition: read_options.h:47
std::string index_name
If non-empty, the name of an index on a database table.
Definition: read_options.h:34
Contains all the Cloud Spanner C++ client types and functions.
#define SPANNER_CLIENT_NS
Definition: version.h:22
std::int64_t limit
Limit on the number of rows to yield, or 0 for no limit.
Definition: read_options.h:40
Options passed to Client::Read or Client::PartitionRead.
Definition: read_options.h:28