summaryrefslogtreecommitdiffstats
path: root/common/storage
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-07 02:34:10 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-07 02:34:10 +0200
commita98311fbc807b83ecfc65a17f98464e5f1f9b3f8 (patch)
treea0c954404535fa832f7ddbd4f455fc67fe69bf4e /common/storage
parent32c507fa0565547a187632db8a80c07babb95d9d (diff)
downloadsink-a98311fbc807b83ecfc65a17f98464e5f1f9b3f8.tar.gz
sink-a98311fbc807b83ecfc65a17f98464e5f1f9b3f8.zip
Fixed getUids by type filtering.
We used to simply return all uids. Requires "sinksh upgrade"
Diffstat (limited to 'common/storage')
-rw-r--r--common/storage/entitystore.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 1ac87b7..5514e31 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -267,7 +267,7 @@ bool EntityStore::add(const QByteArray &type, ApplicationDomain::ApplicationDoma
267 [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << entity.identifier() << newRevision; }); 267 [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << entity.identifier() << newRevision; });
268 DataStore::setMaxRevision(d->transaction, newRevision); 268 DataStore::setMaxRevision(d->transaction, newRevision);
269 DataStore::recordRevision(d->transaction, newRevision, entity.identifier(), type); 269 DataStore::recordRevision(d->transaction, newRevision, entity.identifier(), type);
270 DataStore::recordUid(d->transaction, entity.identifier()); 270 DataStore::recordUid(d->transaction, entity.identifier(), type);
271 SinkTraceCtx(d->logCtx) << "Wrote entity: " << entity.identifier() << type << newRevision; 271 SinkTraceCtx(d->logCtx) << "Wrote entity: " << entity.identifier() << type << newRevision;
272 return true; 272 return true;
273} 273}
@@ -379,7 +379,7 @@ bool EntityStore::remove(const QByteArray &type, const Sink::ApplicationDomain::
379 [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << uid << newRevision; }); 379 [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << uid << newRevision; });
380 DataStore::setMaxRevision(d->transaction, newRevision); 380 DataStore::setMaxRevision(d->transaction, newRevision);
381 DataStore::recordRevision(d->transaction, newRevision, uid, type); 381 DataStore::recordRevision(d->transaction, newRevision, uid, type);
382 DataStore::removeUid(d->transaction, uid); 382 DataStore::removeUid(d->transaction, uid, type);
383 return true; 383 return true;
384} 384}
385 385
@@ -638,7 +638,7 @@ ApplicationDomain::ApplicationDomainType EntityStore::readPrevious(const QByteAr
638 638
639void EntityStore::readAllUids(const QByteArray &type, const std::function<void(const QByteArray &uid)> callback) 639void EntityStore::readAllUids(const QByteArray &type, const std::function<void(const QByteArray &uid)> callback)
640{ 640{
641 DataStore::getUids(d->getTransaction(), callback); 641 DataStore::getUids(type, d->getTransaction(), callback);
642} 642}
643 643
644bool EntityStore::contains(const QByteArray &type, const QByteArray &uid) 644bool EntityStore::contains(const QByteArray &type, const QByteArray &uid)