partial refactor of CassandraBackend

This commit is contained in:
CJ Cobb
2021-03-02 16:19:14 -05:00
parent 8691cff8df
commit 308c585801
15 changed files with 490 additions and 1247 deletions

View File

@@ -2,6 +2,7 @@
#define RIPPLE_APP_REPORTING_BACKENDFACTORY_H_INCLUDED
#include <reporting/BackendInterface.h>
#include <reporting/CassandraBackend.h>
#include <reporting/PostgresBackend.h>
namespace Backend {
std::unique_ptr<BackendInterface>
makeBackend(boost::json::object const& config)
@@ -14,6 +15,12 @@ makeBackend(boost::json::object const& config)
dbConfig.at("cassandra").as_object());
return std::move(backend);
}
else if (dbConfig.contains("postgres"))
{
auto backend = std::make_unique<PostgresBackend>(
dbConfig.at("postgres").as_object());
return std::move(backend);
}
return nullptr;
}
} // namespace Backend