postgres_to_polars/models/
client_options.rs

1#[derive(Debug, Clone)]
2pub struct ClientOptions {
3    pub user: String,
4    pub password: String,
5    pub database: String,
6    pub host: String,
7    pub port: u16,
8    pub monkey_chaos_already_prepare: bool,
9}
10
11impl ClientOptions {
12    pub fn new(user: String, password: String, database: String, host: String, port: u16) -> Self {
13        ClientOptions {
14            user,
15            password,
16            database,
17            host,
18            port,
19            monkey_chaos_already_prepare: false,
20        }
21    }
22
23    pub fn with_monkey_chaos_already_prepare(mut self) -> Self {
24        self.monkey_chaos_already_prepare = true;
25        self
26    }
27
28    pub fn connect_url(&self) -> String {
29        format!("{}:{}", self.host, self.port)
30    }
31}