summaryrefslogtreecommitdiffstats
path: root/common/storage
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-06-19 11:04:17 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-06-19 11:10:47 +0200
commit077e3cb30ace5f6ee20ee15e0d32d2bfb197fde0 (patch)
tree3cfdaf0912ef22dba71755b4332354d579f6e7cf /common/storage
parent1ff4456e5dc2b9a9dfa80047f9e5a4a9e1395cdf (diff)
downloadsink-077e3cb30ace5f6ee20ee15e0d32d2bfb197fde0.tar.gz
sink-077e3cb30ace5f6ee20ee15e0d32d2bfb197fde0.zip
Implement Overlap queries
Summary: Notes: - Introduces the concept of queries on multiple properties (which meant changing query's internals a bit) - Dates are stored as well as the "reference" in the index to allow quick filtering without fetching the whole entity - Buckets are weeks starting on Monday (guaranteed by the use of the Julian calendar) - Some size improvements are definitely possible (dates are padded numbers again, not using integer databases, Julian calendar starts at a very old date, etc.) Test Plan: Tested in querytest Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13477
Diffstat (limited to 'common/storage')
-rw-r--r--common/storage/entitystore.cpp2
-rw-r--r--common/storage/entitystore.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 230dbc7..4fe7e3b 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -443,7 +443,7 @@ QVector<QByteArray> EntityStore::fullScan(const QByteArray &type)
443 return keys.toList().toVector(); 443 return keys.toList().toVector();
444} 444}
445 445
446QVector<QByteArray> EntityStore::indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArray> &appliedFilters, QByteArray &appliedSorting) 446QVector<QByteArray> EntityStore::indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArrayList> &appliedFilters, QByteArray &appliedSorting)
447{ 447{
448 if (!d->exists()) { 448 if (!d->exists()) {
449 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type; 449 SinkTraceCtx(d->logCtx) << "Database is not existing: " << type;
diff --git a/common/storage/entitystore.h b/common/storage/entitystore.h
index d79a0b5..ffa70b9 100644
--- a/common/storage/entitystore.h
+++ b/common/storage/entitystore.h
@@ -57,7 +57,7 @@ public:
57 bool hasTransaction() const; 57 bool hasTransaction() const;
58 58
59 QVector<QByteArray> fullScan(const QByteArray &type); 59 QVector<QByteArray> fullScan(const QByteArray &type);
60 QVector<QByteArray> indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArray> &appliedFilters, QByteArray &appliedSorting); 60 QVector<QByteArray> indexLookup(const QByteArray &type, const QueryBase &query, QSet<QByteArrayList> &appliedFilters, QByteArray &appliedSorting);
61 QVector<QByteArray> indexLookup(const QByteArray &type, const QByteArray &property, const QVariant &value); 61 QVector<QByteArray> indexLookup(const QByteArray &type, const QByteArray &property, const QVariant &value);
62 void indexLookup(const QByteArray &type, const QByteArray &property, const QVariant &value, const std::function<void(const QByteArray &uid)> &callback); 62 void indexLookup(const QByteArray &type, const QByteArray &property, const QVariant &value, const std::function<void(const QByteArray &uid)> &callback);
63 template<typename EntityType, typename PropertyType> 63 template<typename EntityType, typename PropertyType>