forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnection.cc
More file actions
118 lines (98 loc) · 4.13 KB
/
connection.cc
File metadata and controls
118 lines (98 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "google/cloud/internal/disable_deprecation_warnings.inc"
#include "google/cloud/spanner/connection.h"
#include "google/cloud/spanner/query_partition.h"
#include "google/cloud/spanner/read_partition.h"
namespace google {
namespace cloud {
namespace spanner {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {
class StatusOnlyResultSetSource : public ResultSourceInterface {
public:
explicit StatusOnlyResultSetSource(Status status)
: status_(std::move(status)) {}
StatusOr<Row> NextRow() override { return status_; }
absl::optional<google::spanner::v1::ResultSetMetadata> Metadata() override {
return {};
}
absl::optional<google::spanner::v1::ResultSetStats> Stats() const override {
return {};
}
private:
Status status_;
};
} // namespace
// NOLINTNEXTLINE(performance-unnecessary-value-param)
RowStream Connection::Read(ReadParams) {
return RowStream(std::make_unique<StatusOnlyResultSetSource>(
Status(StatusCode::kUnimplemented, "not implemented")));
}
StatusOr<std::vector<ReadPartition>> Connection::PartitionRead(
PartitionReadParams) { // NOLINT(performance-unnecessary-value-param)
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
RowStream Connection::ExecuteQuery(SqlParams) {
return RowStream(std::make_unique<StatusOnlyResultSetSource>(
Status(StatusCode::kUnimplemented, "not implemented")));
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
StatusOr<DmlResult> Connection::ExecuteDml(SqlParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
ProfileQueryResult Connection::ProfileQuery(SqlParams) {
return ProfileQueryResult(std::make_unique<StatusOnlyResultSetSource>(
Status(StatusCode::kUnimplemented, "not implemented")));
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
StatusOr<ProfileDmlResult> Connection::ProfileDml(SqlParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
StatusOr<ExecutionPlan> Connection::AnalyzeSql(SqlParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
StatusOr<PartitionedDmlResult> Connection::ExecutePartitionedDml(
ExecutePartitionedDmlParams) { // NOLINT(performance-unnecessary-value-param)
return Status(StatusCode::kUnimplemented, "not implemented");
}
StatusOr<std::vector<QueryPartition>> Connection::PartitionQuery(
PartitionQueryParams) { // NOLINT(performance-unnecessary-value-param)
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
StatusOr<BatchDmlResult> Connection::ExecuteBatchDml(ExecuteBatchDmlParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
StatusOr<CommitResult> Connection::Commit(CommitParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
Status Connection::Rollback(RollbackParams) {
return Status(StatusCode::kUnimplemented, "not implemented");
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
BatchedCommitResultStream Connection::BatchWrite(BatchWriteParams) {
return internal::MakeStreamRange<BatchedCommitResult>(
[] { return Status(StatusCode::kUnimplemented, "not implemented"); });
}
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace spanner
} // namespace cloud
} // namespace google
#include "google/cloud/internal/diagnostics_pop.inc"