aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/db/DatabasePlugin.hxx10
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx2
-rw-r--r--src/db/plugins/SimpleDatabasePlugin.cxx2
3 files changed, 12 insertions, 2 deletions
diff --git a/src/db/DatabasePlugin.hxx b/src/db/DatabasePlugin.hxx
index 7655d8e2d..831101786 100644
--- a/src/db/DatabasePlugin.hxx
+++ b/src/db/DatabasePlugin.hxx
@@ -33,6 +33,12 @@ class DatabaseListener;
class Database;
struct DatabasePlugin {
+ /**
+ * This plugin requires a #Storage instance. It contains only
+ * cached metadata from files in the #Storage.
+ */
+ static constexpr unsigned FLAG_REQUIRE_STORAGE = 0x1;
+
const char *name;
unsigned flags;
@@ -43,6 +49,10 @@ struct DatabasePlugin {
Database *(*create)(EventLoop &loop, DatabaseListener &listener,
const config_param &param,
Error &error);
+
+ constexpr bool RequireStorage() const {
+ return flags & FLAG_REQUIRE_STORAGE;
+ }
};
#endif
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index 824c1af46..e46b4b9e8 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -780,6 +780,6 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
const DatabasePlugin proxy_db_plugin = {
"proxy",
- 0,
+ DatabasePlugin::FLAG_REQUIRE_STORAGE,
ProxyDatabase::Create,
};
diff --git a/src/db/plugins/SimpleDatabasePlugin.cxx b/src/db/plugins/SimpleDatabasePlugin.cxx
index 8632fa5af..48d014e55 100644
--- a/src/db/plugins/SimpleDatabasePlugin.cxx
+++ b/src/db/plugins/SimpleDatabasePlugin.cxx
@@ -337,6 +337,6 @@ SimpleDatabase::Save(Error &error)
const DatabasePlugin simple_db_plugin = {
"simple",
- 0,
+ DatabasePlugin::FLAG_REQUIRE_STORAGE,
SimpleDatabase::Create,
};