Closed francisstephan closed 2 months ago
Hey there - thanks for letting us know!
This does looks like it needs correcting. You need to use libsql::Database
as per the updated source code, as using a connection tends to time out if you don't use it for more than 10-15s and cause the connection to not work anymore.
Fixed by #292
TursoOutput: IntoResource<Connection>
is not satisfied --> src/main.rs:17:1IntoResource<Connection>
is not implemented forTursoOutput
= help: the trait
IntoResource<libsql::database::Database>
is implemented forTursoOutput
= help: for that trait implementation, expectedlibsql::database::Database
, foundConnection
= note: this error originates in the attribute macroshuttle_runtime::main
(in Nightly builds, run with -Z macro-backtrace for more info) Here is my Cargo.toml: [package] name = "chinese-writer" version = "0.1.0" edition = "2021"[dependencies] axum = { version="0.7.5", features=["macros","form"] } lazy_static = "1.5.0" libsql = "0.5.0" serde = "1.0.207" shuttle-axum = "0.47.0" shuttle-runtime = "0.47.0" shuttle-turso = "0.47.0" tera = "1.20.0" tokio = "1.28.2" tower-http = { version="0.5.2", features=["fs"] }
and my main.rs:
use axum::{ routing::get, Router, }; use libsql::Connection; use tower_http::services::ServeDir; use shuttle_axum::ShuttleAxum; mod handlers;
[shuttle_runtime::main]
async fn app(
[shuttle_turso::Turso(
)-> shuttle_axum::ShuttleAxum { let router = Router::new() .route("/", get(handlers::index)) .nest_service("/assets", ServeDir::new("./vol/assets"));
}