use pyo3::prelude::*;
use crate::sql::pg::PostgresConnectOptions;
#[pymethods]
#[pyo3_stub_gen::derive::gen_stub_pymethods(module = "nautilus_trader.infrastructure")]
impl PostgresConnectOptions {
#[new]
#[pyo3(signature = (host, port, user, password, database))]
const fn py_new(
host: String,
port: u16,
user: String,
password: String,
database: String,
) -> Self {
Self::new(host, port, user, password, database)
}
fn __repr__(&self) -> String {
format!(
"PostgresConnectOptions(host={}, port={}, username={}, database={})",
self.host, self.port, self.username, self.database
)
}
#[getter]
fn host(&self) -> String {
self.host.clone()
}
#[getter]
const fn port(&self) -> u16 {
self.port
}
#[getter]
fn username(&self) -> String {
self.username.clone()
}
#[getter]
fn password(&self) -> String {
self.password.clone()
}
#[getter]
fn database(&self) -> String {
self.database.clone()
}
}