getting rid of diesel

This commit is contained in:
Gabor Körber 2023-12-19 22:17:00 +01:00 committed by Gabor Körber
parent 81586e2970
commit 7cee103035
8 changed files with 1834 additions and 70 deletions

1859
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -11,11 +11,14 @@ use_barrel = ["barrel", "sqlformat"]
default = ["use_barrel"]
[dependencies]
sea-orm = { version = "0.12.10", features = [
"runtime-tokio-native-tls",
"sqlx-postgres",
] }
sqlformat = { version = "0.2.2", optional = true }
anyhow = "1.0.75"
axum = "0.6.20"
barrel = { version = "0.7.0", optional = true, features = ["pg"] }
diesel = { version = "2.1.3", features = ["serde_json", "postgres"] }
dotenvy = "0.15.7"
mime_guess = "2.0.4"
minijinja = { version = "1.0.8", features = [

8
src/auth/models.rs Normal file
View File

@ -0,0 +1,8 @@
pub struct User {
pub id: i32,
pub username: String,
}
pub struct NewUser<'a> {
pub username: &'a str,
}

View File

@ -1,5 +1,4 @@
pub mod admin;
pub mod schema;
pub mod auth;
pub mod service;
pub mod state;
pub mod users;

View File

@ -1,8 +0,0 @@
// @generated automatically by Diesel CLI.
diesel::table! {
users (id) {
id -> Int4,
username -> Varchar,
}
}

View File

@ -1,15 +0,0 @@
use diesel::prelude::*;
#[derive(Queryable, Selectable)]
#[diesel(table_name = crate::schema::users)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct User {
pub id: i32,
pub username: String,
}
#[derive(Insertable)]
#[diesel(table_name = crate::schema::users)]
pub struct NewUser<'a> {
pub username: &'a str,
}

View File

@ -1,6 +0,0 @@
# Users
The most basic requirement of most services is authentication or identifying users.
This module should aim to provide that.