mirror of
https://github.com/kristoferssolo/echoes-of-ascension.git
synced 2025-10-21 18:50:34 +00:00
18 lines
397 B
Rust
18 lines
397 B
Rust
use leptos::config::LeptosOptions;
|
|
use sqlx::{postgres::PgPoolOptions, PgPool};
|
|
use std::sync::Arc;
|
|
|
|
use crate::config::DatabaseSettings;
|
|
|
|
pub type AppState = Arc<App>;
|
|
|
|
#[derive(Debug)]
|
|
pub struct App {
|
|
pub pool: PgPool,
|
|
pub leptos_options: LeptosOptions,
|
|
}
|
|
|
|
pub fn get_connection_pool(config: &DatabaseSettings) -> PgPool {
|
|
PgPoolOptions::new().connect_lazy_with(config.with_db())
|
|
}
|