-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres backend in Axum: Cannot start a runtime from within a runtime. #275
Comments
That is unfortunately a known issue. Here's what's going on
I would like to offer async capabilities in Butane. Progress has been slow I'm afraid due to both lack of time on my part as well as complications from my desire to offer both sync and async interfaces at the same time, without duplicating all the code and without major breaking changes to the existing sync APIs. However, async with Butane is actually getting really close, and is ready for feedback! You can check it out on the async-wip branch. As of this week, I expect the API to be stable, although that's not a guarantee. If you're interested in giving it a whirl, it should solve your issues with Axum. On the other hand, if you're not up for being an early adopter, it should be possible to use channels to run your database operations on a separate thread to avoid the runtime nesting. If you'd like to chat more about that I'm happy to provide some pointers, as that's similar to what I've done in the See also #13 |
Nice! |
Hi!
I'm still going at using Butane within a Leptos/Axum project.
I got to a decent point where I'd like to have more visibility on database changes and types, so I switched from SQLite to Postgres.
Unfortunately when I try to use the database I now get a:
and a backtrace. Searching around I found tokio-rs/tokio#2194 where they say it's quite normal since the postgres crate doesn't support async, so if you try to await something you'll cause this... they recommend using a
tokio-postgres
crate instead.Did anyone see this before? Could it be I'm doing something wrong in how I manage the r2d2 connection instead?
The text was updated successfully, but these errors were encountered: