Implement new DB changes API#1138
Conversation
Thanks for details, I'll check it and let you know. |
|
@fvacek
I'm not sure we're on the same page. I expected it to work like the existing database events, but with the difference that it would handle the actual data changes rather than just the competitor IDs. As far as I understand, this change isn't currently much more suitable for OFeed than the existing database events. |
|
Related #1063 |
@lukaskett |
Changes are not currently propagated to other QE instances. My understanding is that o-feed is interested on local changes, which are sent to o-feed and then distributed via o-feed service to other clients. |
sorry, i overlooked, it works. |
Yes, but that would require the OFeed service to be running on every QE instance. The idea was to have one pc for sending changes to OFeed (and process changes from other origins), which is more robust than having to manage the service on every QE instance in my point of view. |
Well, I can add DB_EVENT for this, but I rather like to make short meeting with you to make things clear. |
Usage example:
QObject::connect(&app, &Application::dbRecChng, &app, [](const qf::core::sql::RecChng &recchng) {
auto dump_map = [](const QVariantMap &m) {
QStringList rows;
for (const auto &[k, v] : m.asKeyValueRange()) {
rows << QStringLiteral("%1 -> %2").arg(k).arg(v.toString());
}
return rows.join('\n');
};
qfInfo() << "REC-CHNG table:" << recchng.table
<< "op:" << qf::core::sql::RecChng::recopToString(recchng.op)
<< "id:" << recchng.id
<< "record:" << dump_map(recchng.record);
});


I'm not able to finish #1069 in near future, but DB cange API is finished already.
@lukaskett please check if this API fits also needs of O-feed
Usage example: