Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
remove configuration of table-name
Browse files Browse the repository at this point in the history
  • Loading branch information
Sir-Photch committed Oct 1, 2023
1 parent dc0d9ba commit fce1a65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ DB_HOSTNAME = "localhost"
DB_USERNAME = "your username"
DB_PASSWORD = "your password"
DB_NAME = "dab_rs"
DB_TABLE = "GuildDetails"
LOG_PATH = "/path/to/log.file"
```
- `USERDATA_DIR` specifies the path where the chimes will be saved.
Expand All @@ -100,7 +99,7 @@ LOG_PATH = "/path/to/log.file"
- `CONNECTION_TIMEOUT_MILLISECONDS` is the duration that the bot will remain connected to a channel, after no other user joins a channel in the guild, in milliseconds.
- `RESOURCE_DIR` is the path to the directory containing the folder structure for localization.
- `DEFAULT_LOCALE` is the fallback locale that is to be used when translations for a users locale are not available.
- `DB_*` are the credentials and connection details to the mysql-database that dab-rs will use.
- `DB_*` are the credentials and connection details to the postgresql-database that dab-rs will use.
- `LOG_PATH` is the file where logs will be saved to.

#### Commandline options
Expand Down
4 changes: 2 additions & 2 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub struct DatabaseInterface {
table_name: String,
}
impl DatabaseInterface {
pub fn new(client: tokio_postgres::Client, table_name: String) -> Self {
DatabaseInterface { client, table_name }
pub fn new(client: tokio_postgres::Client, table_name: &str) -> Self {
DatabaseInterface { client: client, table_name: table_name.to_owned() }
}

pub async fn ensure_table_exists(&self) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async fn main() {
}
});

let database_interface = data::DatabaseInterface::new(client, settings["DB_TABLE"].to_owned());
let database_interface = data::DatabaseInterface::new(client, "GuildDetails");

database_interface.ensure_table_exists().await;

Expand Down

0 comments on commit fce1a65

Please sign in to comment.