mirror of
https://codeberg.org/selfsigned-ash/antifed
synced 2026-07-21 18:49:34 +02:00
⚡ Adds basic structure
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::{Queryable, Selectable};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Queryable, Selectable)]
|
||||
#[diesel(table_name = crate::schema::actions)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
pub struct Action {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub source: String,
|
||||
pub created_at: NaiveDateTime,
|
||||
pub updated_at: NaiveDateTime,
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
use diesel::PgConnection;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
mod action;
|
||||
|
||||
pub struct AppState {
|
||||
pub db: Arc<Mutex<PgConnection>>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn new(db: PgConnection) -> Self {
|
||||
Self {
|
||||
db: Arc::new(Mutex::new(db)),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user