-
Hello! Is there any general way for caching SQL queries? I mean, for example, how to cache Poco::Data::RecordSet with Poco::Redis. I cannot find any readme or how to. There is only api docs https://docs.pocoproject.org/current/Poco.Redis.html and nothing more. Thank you in advance |
Beta Was this translation helpful? Give feedback.
Answered by
xakod
Oct 3, 2022
Replies: 1 comment
-
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); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xakod
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example with Poco::RecordSet and json to Redis