-
Notifications
You must be signed in to change notification settings - Fork 198
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
start migration more web endpoints to sqlx #2311
Conversation
|
I had a quick look at this. The biggest blocker is that all the database calls in the test fakes need to be moved over too, otherwise they error like
It's also non-trivial because of the higher-ranked lifetimes meaning that closures don't work, I think the best approach might be to use a macro to wrap the tests giving an API like async_tests! {
async fn foo(env: &TestEnvironment) -> Result<()> {
...
}
} You can see my experiment in the wrapper here, with the inner |
I remember I made it work by using an async closure +
yep, the sync/async mix makes some things a little ugly until more is migrated. |
4b8f02c
to
eb72599
Compare
eb72599
to
114faa4
Compare
I accidentally amended other changes from #2312 to the release-time-nullable commit, so now I just squashed them all to avoid more confusion. |
refs #874
This migrates more web endpoints to sqlx.
Notable omissions around
Limits
andCrateDetails
, which should be async too, but I wanted to leave them for another PR.Also I want to find a better way to use async in tests, bestrefs #874
This migrates more web endpoints to sqlx.
Notable omissions around
Limits
andCrateDetails
, which should be async too, but I wanted to leave them for another PR.Also I want to find a better way to use async in tests, best case even using
tokio::test
or evensqlx::test
, at the least someasync_wrapper
that enables you to write.await
in tests. Also for a separate PR. case even usingtokio::test
or evensqlx::test
, at the least someasync_wrapper
that enables you to write.await
in tests. Also for a separate PR.Last think I also didn't do is parallelization of independent queries in a single handler, which could be investigated separately.