You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Path: /resources/shuttle-turso
When I implement the code snippet in the docs I get the following error at compilation:
error[E0277]: the trait bound TursoOutput: IntoResource<Connection> is not satisfied
--> src/main.rs:17:1
|
17 | #[shuttle_runtime::main]
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait IntoResource<Connection> is not implemented for TursoOutput
|
= help: the trait IntoResource<libsql::database::Database> is implemented for TursoOutput
= help: for that trait implementation, expected libsql::database::Database, found Connection
= note: this error originates in the attribute macro shuttle_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"
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.
Path: /resources/shuttle-turso
When I implement the code snippet in the docs I get the following error at compilation:
error[E0277]: the trait bound
TursoOutput: IntoResource<Connection>
is not satisfied--> src/main.rs:17:1
|
17 | #[shuttle_runtime::main]
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait
IntoResource<Connection>
is not implemented forTursoOutput
|
= help: the trait
IntoResource<libsql::database::Database>
is implemented forTursoOutput
= help: for that trait implementation, expected
libsql::database::Database
, foundConnection
= note: this error originates in the attribute macro
shuttle_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(
addr="libsql://zidian-francisstephan.turso.io",
token="{secrets.DB_TURSO_TOKEN}")]
client: Connection
)-> shuttle_axum::ShuttleAxum {
let router = Router::new()
.route("/", get(handlers::index))
.nest_service("/assets", ServeDir::new("./vol/assets"));
}
The text was updated successfully, but these errors were encountered: