//! Message repository — struct definition and pool accessor. //! //! CRUD operations are split across `message_create.rs` (writes) //! and `message_query.rs` (reads) as separate `impl` blocks. use sqlx::PgPool; /// Repository for message CRUD operations. /// /// All queries use parameterized statements via sqlx. /// IDs are UUID v7 (time-ordered) for efficient cursor pagination. #[derive(Clone)] pub struct MessageRepo { pool: PgPool, } impl MessageRepo { /// Create a new repository backed by the given connection pool. pub fn new(pool: PgPool) -> Self { Self { pool } } /// Access the inner `PgPool` for advanced queries. pub fn pool(&self) -> &PgPool { &self.pool } }