diff options
| author | ilotterytea <iltsu@alright.party> | 2024-04-30 00:57:09 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-04-30 00:57:09 +0500 |
| commit | 4eb4d18ea4ddaf927f8a37bc702228f7ef468c40 (patch) | |
| tree | 87c1e474d116fad3bd252732ec9cfca05026a117 /src/config.cpp | |
| parent | d8d62ca07f55b88674b3c59d95c7eb7e8b2e4f4d (diff) | |
feat: database configuration
Diffstat (limited to 'src/config.cpp')
| -rw-r--r-- | src/config.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp index 2d1b876..1a11f0b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -19,6 +19,7 @@ namespace bot { } Configuration cfg; + DatabaseConfiguration db_cfg; std::string line; while (std::getline(ifs, line, '\n')) { @@ -37,9 +38,21 @@ namespace bot { cfg.bot_username = value; } else if (key == "bot_password") { cfg.bot_password = value; + } else if (key == "db_name") { + db_cfg.name = value; + } else if (key == "db_user") { + db_cfg.user = value; + } else if (key == "db_password") { + db_cfg.password = value; + } else if (key == "db_host") { + db_cfg.host = value; + } else if (key == "db_port") { + db_cfg.port = value; } } + cfg.database = db_cfg; + return cfg; } } |
