What is the benefits of using connect_lazy over connect in PgPoolOptions #1208
Unanswered
thangchung
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have searched around in this repo and the internet to see what is the difference between
connect_lazy
andconnect
functions when usingsqlx
. I found thedocs
at https://docs.rs/sqlx/0.4.1/sqlx/pool/struct.PoolOptions.html. Is it quite clear to me.But I just don't convince myself that what is the benefit of using
connect_lazy
overconnect
functions? Because when used withconnect_lazy
, we might sacrifice theasync/await model
, and it might not good forthe intensive I/O application type
. Is it right?When uses with
connect_lazy
, the code looks likeBut when used with
connect
, it hasasync
by the end likeCould anyone explain a bit about this for us? Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions