You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
use cfg_if::cfg_if;
|
|
|
|
pub mod data;
|
|
|
|
cfg_if!{
|
|
if #[cfg(feature = "ssr")] {
|
|
use sqlx::PgPool;
|
|
|
|
#[derive(Clone)]
|
|
pub struct AppData {
|
|
db_pool: PgPool
|
|
}
|
|
|
|
impl AppData {
|
|
pub fn new(db_pool: PgPool) -> Self {
|
|
Self {
|
|
db_pool
|
|
}
|
|
}
|
|
|
|
pub fn db_pool(&self) -> &PgPool {
|
|
&self.db_pool
|
|
}
|
|
}
|
|
}
|
|
} |