summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-04-30 01:06:57 +0500
committerilotterytea <iltsu@alright.party>2024-04-30 01:06:57 +0500
commit7813d34268513a775faea45cb96ae6ee2bcd983d (patch)
tree177a7a52558cb068ab8f1cbd12c7d0235d2d65d5 /src
parent4eb4d18ea4ddaf927f8a37bc702228f7ef468c40 (diff)
feat: macro for generating database connection urls
Diffstat (limited to 'src')
-rw-r--r--src/config.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.hpp b/src/config.hpp
index 6f4c765..2e02f1d 100644
--- a/src/config.hpp
+++ b/src/config.hpp
@@ -3,6 +3,11 @@
#include <optional>
#include <string>
+#define GET_DATABASE_CONNECTION_URL(c) \
+ "dbname = " + c.database.name + " user = " + c.database.user + \
+ " password = " + c.database.password + " host = " + c.database.host + \
+ " port = " + c.database.port
+
namespace bot {
struct DatabaseConfiguration {
std::string name;