Closed rylev closed 1 year ago
@rylev Sure thing! Just published 0.31.5 with some of the pub(crate)
constructors published as pub
. The following will work to create a sync reqwest-based client:
use libsql_client::{Client, http, reqwest};
let inner = http::InnerClient::Reqwest(reqwest::HttpClient::new());
let client = Client::Http(http::Client::from_env(inner)?);
Awesome. Thank you for the quick response! 🎉
For my use case, I only ever want to use the HTTP client, however it seems I'm currently forced to go through the generic client construction code path. This wouldn't really be an issue, but the generic client construction is
async
because thehrana
client needs it - even though I'm not using it. Additionally, the generic client is notClone
while the HTTP one is. This impacts my code which does not expect sqld client construction to be async and expects to be able to clone the client. I could work around these issues (by usingtokio::Runtime::block_on
andArc
), but it makes my code much more complicated.Would it be possible to make construction of the HTTP client public so that I can directly use that?