diff --git a/resources/turso/Cargo.toml b/resources/turso/Cargo.toml index 45685f77d..077887b62 100644 --- a/resources/turso/Cargo.toml +++ b/resources/turso/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["shuttle-service", "turso"] [dependencies] async-trait = "0.1.56" dunce = "1.0.4" -libsql = { version = "0.2.0", default-features = false, features = ["core", "remote"] } +libsql = { version = "0.3.1", default-features = false, features = ["core", "remote"] } serde = { version = "1", features = ["derive"] } shuttle-service = { path = "../../service", version = "0.42.0" } url = { version = "2.3.1", features = ["serde"] } diff --git a/resources/turso/src/lib.rs b/resources/turso/src/lib.rs index 1159ec9bd..3f7facc81 100644 --- a/resources/turso/src/lib.rs +++ b/resources/turso/src/lib.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use libsql::{Connection, Database}; +use libsql::{Builder, Connection}; use serde::{Deserialize, Serialize}; use shuttle_service::{ error::{CustomError, Error as ShuttleError}, @@ -123,7 +123,7 @@ impl ResourceInputBuilder for Turso { impl IntoResource for TursoOutput { async fn into_resource(self) -> Result { let database = if self.remote { - Database::open_remote( + Builder::new_remote( self.conn_url.to_string(), self.token .clone() @@ -131,8 +131,10 @@ impl IntoResource for TursoOutput { "missing token for remote database", )))?, ) + .build() + .await } else { - Database::open(self.conn_url.to_string()) + Builder::new_local(self.conn_url.to_string()).build().await }; database .map_err(|err| ShuttleError::Custom(err.into()))?