Skip to content

Poco::Redis with Poco::Data #3777

Answered by xakod
xakod asked this question in Q&A
Discussion options

You must be logged in to vote

Example with Poco::RecordSet and json to Redis

Poco::Data::RowFormatter::Ptr jsonRowFormatter = new Poco::Data::JSONRowFormatter;

Poco::Data::RecordSet recordSet(statement, jsonRowFormatter);

std::stringstream ss;
recordSet.copy(ss);

auto&& payload = ss.str();

auto setCommand = Poco::Redis::Command::set(key, payload);
std::string result = redis.execute<std::string>(setCommand);
poco_assert(result.compare("OK") == 0);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xakod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant