From 620cf8fa33835c1ce1e56b1028ff6e2a6fbe0f39 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 9 Jul 2026 22:00:59 +0200 Subject: chore: Add more things --- crates/server/src/database/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/server/src/database/mod.rs') diff --git a/crates/server/src/database/mod.rs b/crates/server/src/database/mod.rs index 43fe5c3b..c05fa783 100644 --- a/crates/server/src/database/mod.rs +++ b/crates/server/src/database/mod.rs @@ -1,12 +1,12 @@ -pub(crate) mod db; -pub(crate) mod models; +pub mod db; +pub mod models; use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; #[derive(Debug)] -pub(crate) enum DbError { +pub enum DbError { NotFound, Other(eyre::Report), } @@ -43,24 +43,24 @@ impl From for DbError { impl std::error::Error for DbError {} -pub(crate) type DbResult = Result; +pub type DbResult = Result; #[derive(Debug, PartialEq)] -pub(crate) enum DbType { +pub enum DbType { Postgres, Unknown, } #[derive(Clone, Deserialize, Serialize)] -pub(crate) struct DbSettings { - pub(crate) db_uri: String, +pub struct DbSettings { + pub db_uri: String, /// Optional URI for read replicas. If set, read-only queries will use this connection. - pub(crate) read_db_uri: Option, + pub read_db_uri: Option, } impl DbSettings { - pub(crate) fn db_type(&self) -> DbType { + pub fn db_type(&self) -> DbType { if self.db_uri.starts_with("postgres://") || self.db_uri.starts_with("postgresql://") { DbType::Postgres } else { -- cgit v1.3.1