15 lines
378 B
Rust
15 lines
378 B
Rust
use mid_chat::event::ChatEvent;
|
|
|
|
pub mod db;
|
|
pub mod prelude;
|
|
pub mod service;
|
|
|
|
pub type ChatEventSender = tokio::sync::broadcast::Sender<ChatEvent>;
|
|
pub type ChatEventReceiver = tokio::sync::broadcast::Receiver<ChatEvent>;
|
|
|
|
pub async fn open_core_db() -> sqlx::Result<sqlx::SqlitePool> {
|
|
let db = db::open("main").await?;
|
|
sqlx::migrate!().run(&db).await?;
|
|
Ok(db)
|
|
}
|