Adds basic structure

This commit is contained in:
2026-07-05 10:24:47 +02:00
parent ee79500c87
commit aef4abc72c
4 changed files with 139 additions and 2 deletions
+14
View File
@@ -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,
}
+16
View File
@@ -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)),
}
}
}