feat: add PostgreSQL connection form

This commit is contained in:
Valdemar Lorenzen
2026-10-19 12:22:11 +02:00
parent af7e8cad25
commit 8d533f13dc
4 changed files with 236 additions and 21 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ pub struct Page {
impl Database {
pub fn connect(connection: &str) -> Result<Self> {
let mut config: Config = connection.parse()?;
Self::connect_postgres(connection.parse()?)
}
pub fn connect_postgres(mut config: Config) -> Result<Self> {
if config.get_connect_timeout().is_none() {
config.connect_timeout(Duration::from_secs(5));
}