✨ [seaorm] Añade soporte a SeaORM en PageTop
This commit is contained in:
parent
49ba34ed0e
commit
b8b98e07c7
17 changed files with 3453 additions and 12 deletions
31
packages/pagetop-seaorm/src/lib.rs
Normal file
31
packages/pagetop-seaorm/src/lib.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub mod config;
|
||||
pub mod db;
|
||||
|
||||
/// The package Prelude.
|
||||
pub mod prelude {
|
||||
pub use crate::db;
|
||||
pub use crate::install_migrations;
|
||||
}
|
||||
|
||||
include_locales!(LOCALES_SEAORM);
|
||||
|
||||
/// Implements [`PackageTrait`] and specific package API.
|
||||
pub struct SeaORM;
|
||||
|
||||
impl PackageTrait for SeaORM {
|
||||
fn name(&self) -> L10n {
|
||||
L10n::t("package_name", &LOCALES_SEAORM)
|
||||
}
|
||||
|
||||
fn description(&self) -> L10n {
|
||||
L10n::t("package_description", &LOCALES_SEAORM)
|
||||
}
|
||||
|
||||
fn init(&self) {
|
||||
LazyLock::force(&db::DBCONN);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue