mirror of
https://codeberg.org/selfsigned-ash/antifed
synced 2026-07-21 18:49:34 +02:00
✨ Adds fetching actions
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user