aboutsummaryrefslogtreecommitdiff
path: root/sm-http-server.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-08-07 17:39:23 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-08-07 17:39:23 +0200
commitd2caf82ad16f8d31db6afdd69383ba1c04e02c32 (patch)
treef50b6625b91cee915631a5841330d812e6321882 /sm-http-server.cpp
parent981ba5c5f30549dbd233fab1e52bb774fd3eebe1 (diff)
downloadmqtt-cassandra-bridge-d2caf82ad16f8d31db6afdd69383ba1c04e02c32.tar.gz
mqtt-cassandra-bridge-d2caf82ad16f8d31db6afdd69383ba1c04e02c32.tar.bz2
mqtt-cassandra-bridge-d2caf82ad16f8d31db6afdd69383ba1c04e02c32.tar.xz
mqtt-cassandra-bridge-d2caf82ad16f8d31db6afdd69383ba1c04e02c32.zip
o More explicit bind functions, it is useful because Cassandra is touchy with its types.
o Saving the topic and message id in the raw record table. o Dropping the mosquittopp, it is not very useful.
Diffstat (limited to 'sm-http-server.cpp')
-rw-r--r--sm-http-server.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sm-http-server.cpp b/sm-http-server.cpp
index 80dd68f..e567655 100644
--- a/sm-http-server.cpp
+++ b/sm-http-server.cpp
@@ -59,10 +59,10 @@ void handle_device_get(const request &req, const response &res, string device) {
cout << "handle_device_get(" << device << ");" << endl;
cassandra_statement stmt("SELECT device, timestamp, sensors FROM sm_by_day WHERE device=? AND day IN ?", 2);
- stmt.bind(0, device);
+ stmt.bind_string(0, device);
vector<string> days = {"2015-07-10", "2015-07-11", "2015-07-12", "2015-07-13", "2015-07-14", "2015-07-15",
"2015-07-16"};
- stmt.bind(1, std::move(days));
+ stmt.bind_list(1, std::move(days));
current_cassandra_session->execute(std::move(stmt), [&](cassandra_future& future) {
const cassandra_result result = future.result();