add the initial event

This commit is contained in:
Michael Zhang 2024-11-30 17:17:31 -06:00
parent 7beb26d5ae
commit 14cd99448a

View file

@ -43,13 +43,15 @@ pub struct DatabaseUpdate {}
#[tokio::main]
async fn main() -> Result<()> {
let (tx, database_updates) = mpsc::unbounded_channel();
let (mut tx, database_updates) = mpsc::unbounded_channel();
let db = {
let options = SqliteConnectOptions::new()
.filename("test.db")
.create_if_missing(true);
let tx = tx.clone();
SqlitePoolOptions::new()
.after_connect(move |c, md| {
let tx = tx.clone();
@ -72,6 +74,7 @@ async fn main() -> Result<()> {
let state = AppState { db };
tokio::spawn(worker(state.clone(), database_updates));
tx.send(DatabaseUpdate {});
let app = Router::new()
// Block CRUD