Elimina Refinery y Barrel en favor de SeaORM

Se integran las funcionalidades de SeaORM en el funcionamiento de
PageTop para abstraer el uso y acceso a la base de datos.
This commit is contained in:
Manuel Cillero 2022-03-13 00:19:05 +01:00
parent 619b7b73c6
commit 4b5d8ce38a
16 changed files with 150 additions and 98 deletions

View file

@ -9,15 +9,26 @@
/// ];
/// ```
macro_rules! args {
( $($key:expr => $value:expr),* ) => {{
( $($KEY:expr => $VALUE:expr),* ) => {{
let mut a = std::collections::HashMap::new();
$(
a.insert(String::from($key), $value.into());
a.insert(String::from($KEY), $VALUE.into());
)*
a
}};
}
#[macro_export]
macro_rules! db_migrations {
( $DBCONN:ident ) => {{
$crate::run_now({
use $crate::db::migration::MigratorTrait;
migration::Migrator::up($DBCONN, None)
})
}};
}
pub fn valid_id(id: &str) -> Option<String> {
let id = id.trim().replace(" ", "_").to_lowercase();
match id.is_empty() {