summaryrefslogtreecommitdiffstats
path: root/common/storage/entitystore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage/entitystore.cpp')
-rw-r--r--common/storage/entitystore.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 71690fe..1ba7c6c 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -426,19 +426,19 @@ bool EntityStore::cleanupRevisions(qint64 revision)
426 return cleanupIsNecessary; 426 return cleanupIsNecessary;
427} 427}
428 428
429QVector<QByteArray> EntityStore::fullScan(const QByteArray &type) 429QVector<Identifier> EntityStore::fullScan(const QByteArray &type)
430{ 430{
431 SinkTraceCtx(d->logCtx) << "Looking for : " << type; 431 SinkTraceCtx(d->logCtx) << "Looking for : " << type;
432 if (!d->exists()) { 432 if (!d->exists()) {
433 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type; 433 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type;
434 return QVector<QByteArray>(); 434 return {};
435 } 435 }
436 //The scan can return duplicate results if we have multiple revisions, so we use a set to deduplicate. 436 //The scan can return duplicate results if we have multiple revisions, so we use a set to deduplicate.
437 QSet<QByteArray> keys; 437 QSet<Identifier> keys;
438 DataStore::mainDatabase(d->getTransaction(), type) 438 DataStore::mainDatabase(d->getTransaction(), type)
439 .scan(QByteArray(), 439 .scan(QByteArray(),
440 [&](const QByteArray &key, const QByteArray &value) -> bool { 440 [&](const QByteArray &key, const QByteArray &value) -> bool {
441 const auto uid = Sink::Storage::Key::fromInternalByteArray(key).identifier().toDisplayByteArray(); 441 const auto uid = Sink::Storage::Key::fromInternalByteArray(key).identifier();
442 if (keys.contains(uid)) { 442 if (keys.contains(uid)) {
443 //Not something that should persist if the replay works, so we keep a message for now. 443 //Not something that should persist if the replay works, so we keep a message for now.
444 SinkTraceCtx(d->logCtx) << "Multiple revisions for key: " << key; 444 SinkTraceCtx(d->logCtx) << "Multiple revisions for key: " << key;
@@ -452,11 +452,11 @@ QVector<QByteArray> EntityStore::fullScan(const QByteArray &type)
452 return keys.toList().toVector(); 452 return keys.toList().toVector();
453} 453}
454 454
455QVector<QByteArray> EntityStore::indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArrayList> &appliedFilters, QByteArray &appliedSorting) 455QVector<Identifier> EntityStore::indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArrayList> &appliedFilters, QByteArray &appliedSorting)
456{ 456{
457 if (!d->exists()) { 457 if (!d->exists()) {
458 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type; 458 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type;
459 return QVector<QByteArray>(); 459 return {};
460 } 460 }
461 return d->typeIndex(type).query(query, appliedFilters, appliedSorting, d->getTransaction(), d->resourceContext.instanceId()); 461 return d->typeIndex(type).query(query, appliedFilters, appliedSorting, d->getTransaction(), d->resourceContext.instanceId());
462} 462}