15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_SQL_STATEMENT_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_SQL_STATEMENT_H
18 #include "google/cloud/spanner/value.h"
19 #include "google/cloud/spanner/version.h"
20 #include "google/cloud/status_or.h"
21 #include <google/spanner/v1/spanner.pb.h>
23 #include <unordered_map>
28 namespace spanner_internal {
30 struct SqlStatementInternals;
54 using ParamType = std::unordered_map<std::string,
Value>;
59 : statement_(std::move(statement)) {}
62 : statement_(std::move(statement)), params_(std::move(params)) {}
74 std::string
const&
sql()
const {
return statement_; }
80 ParamType
const&
params()
const {
return params_; }
93 std::string
const& parameter_name)
const;
96 return a.statement_ == b.statement_ && a.params_ == b.params_;
108 friend std::ostream& operator<<(std::ostream& os,
SqlStatement const& stmt);
113 std::string statement_;
121 namespace spanner_internal {
125 using SqlStatementProto =
126 ::
google::spanner::v1::ExecuteBatchDmlRequest::Statement;
128 struct SqlStatementInternals {
133 return SqlStatementInternals::ToProto(std::move(s));