summaryrefslogtreecommitdiff
path: root/bot/src/database.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-07-02 03:31:54 +0500
committerilotterytea <iltsu@alright.party>2025-07-02 03:31:54 +0500
commit79be89ad0491bfdd110b2c612e21a0f28c29fa87 (patch)
tree589daab514de11cc87e424b62d87f8cac12494ab /bot/src/database.cpp
parentfea3c12d6b621796bb239cebb57a5a5014dfe350 (diff)
feat: MARIADB SUPPORT!!!!
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