Adds fetching actions

This commit is contained in:
2026-07-05 11:06:18 +02:00
parent aef4abc72c
commit eb078be3c6
8 changed files with 84 additions and 18 deletions
+7 -7
View File
@@ -1,16 +1,16 @@
use diesel::r2d2::{ConnectionManager, Pool};
use diesel::PgConnection;
use std::sync::{Arc, Mutex};
mod action;
pub const DEFAULT_QUERY_LIMIT: i64 = 100;
pub mod action;
pub struct AppState {
pub db: Arc<Mutex<PgConnection>>,
pub db: Pool<ConnectionManager<PgConnection>>,
}
impl AppState {
pub fn new(db: PgConnection) -> Self {
Self {
db: Arc::new(Mutex::new(db)),
}
pub fn new(pool: Pool<ConnectionManager<PgConnection>>) -> Self {
Self { db: pool }
}
}