systemprompt_analytics/repository/costs/
mod.rs1mod per_user;
11mod platform;
12
13use crate::Result;
14use sqlx::PgPool;
15use std::sync::Arc;
16use systemprompt_database::DbPool;
17
18#[derive(Debug, Clone)]
19pub struct CostAnalyticsRepository {
20 pool: Arc<PgPool>,
21}
22
23impl CostAnalyticsRepository {
24 pub fn new(db: &DbPool) -> Result<Self> {
25 let pool = db.pool_arc()?;
26 Ok(Self { pool })
27 }
28
29 #[must_use]
30 pub const fn from_pool(pool: Arc<PgPool>) -> Self {
31 Self { pool }
32 }
33}