diff --git a/server/src/db.rs b/server/src/db.rs index 7c9b548..2d4575f 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -1,7 +1,7 @@ use app::components::api::Article; use leptos::*; use serde::*; -use sqlx::*; +use sqlx::{sqlite::SqlitePoolOptions, *}; pub async fn db_build(pool: &SqlitePool) -> Result<(), ServerFnError> { let _res = query( @@ -18,7 +18,7 @@ pub async fn db_build(pool: &SqlitePool) -> Result<(), ServerFnError> { .execute(pool) .await?; - // println!("{:?}", _res); + println!("{:?}", _res); #[derive(Deserialize)] struct ArticleFrontmatter { @@ -66,7 +66,7 @@ pub async fn db_build(pool: &SqlitePool) -> Result<(), ServerFnError> { .execute(pool) .await?; - // println!("{:?}", _res); + println!("{:?}", _res); } } } @@ -96,9 +96,11 @@ pub async fn start_pool() -> Result { db goin up" ); - let pool = SqlitePool::connect("sqlite://doordesk.db").await?; + let pool = SqlitePoolOptions::new() + .connect("file::memory:?cache=shared") + .await?; - let _ = db_build(&pool); + let _ = db_build(&pool).await?; Ok(pool) }