From 88d527d574567420d7aa72f37205bd6b345b8dd7 Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sat, 19 Jun 2021 23:10:53 -0600 Subject: generate diesel::table! in derive(Model) --- src/bin/tosin-admin.rs | 5 ++++- src/db/mod.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bin/tosin-admin.rs b/src/bin/tosin-admin.rs index 4ca2d15..034e4a9 100644 --- a/src/bin/tosin-admin.rs +++ b/src/bin/tosin-admin.rs @@ -6,8 +6,11 @@ use std::process::Command; use structopt::StructOpt; -const TOSIN_DEPENDENCY: &str = concat!(r#"tosin = { path = ""#, env!("CARGO_MANIFEST_DIR"), r#"" }"#); +const TOSIN_DEPENDENCY: &str = concat!(r#"tosin = { path = ""#, env!("CARGO_MANIFEST_DIR"), r#"" } +diesel = { version = "1.4.4", features = ["sqlite"] }"#); const PROJECT_MAIN: &str = r#" +#[macro_use] extern crate diesel; + use tosin::Settings; use tosin::contrib::admin; use tosin::db::backend::Connectable; diff --git a/src/db/mod.rs b/src/db/mod.rs index 05c38df..e04fe06 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -1,3 +1,6 @@ pub mod backend; pub mod migration; pub mod models; + +pub use diesel::*; +pub use diesel::backend as diesel_backend; -- cgit v1.2.3