summaryrefslogtreecommitdiff
path: root/bot/src/database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/database.cpp')
-rw-r--r--bot/src/database.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/bot/src/database.cpp b/bot/src/database.cpp
new file mode 100644
index 0000000..dcb7dae
--- /dev/null
+++ b/bot/src/database.cpp
@@ -0,0 +1,13 @@
+#include "database.hpp"
+
+#include <memory>
+
+namespace bot::db {
+ std::unique_ptr<BaseDatabase> create_connection(const Configuration &cfg) {
+#if USE_POSTGRES
+ return std::make_unique<PostgresDatabase>(GET_DATABASE_CONNECTION_URL(cfg));
+#elif defined(USE_MARIADB)
+ return std::make_unique<MariaDatabase>(cfg);
+#endif
+ }
+} \ No newline at end of file