tursodatabase / libsql-client-rs

libSQL Rust client library can be used to communicate with sqld natively over HTTP protocol with native Rust interface.
MIT License
75 stars 27 forks source link

Support Hrana backend without any HTTP backend features enabled #34

Closed george-lim closed 1 year ago

george-lim commented 1 year ago

The current implementation of InnerClient in http module prevents the hrana_backend feature from being enabled without having at least one other HTTP backend feature enabled.

This can be solved if we add conditional compilation to the http module only if a HTTP backend feature is enabled.

#[derive(Clone, Debug)]
pub enum InnerClient {
    #[cfg(feature = "reqwest_backend")]
    Reqwest(crate::reqwest::HttpClient),
    #[cfg(feature = "workers_backend")]
    Workers(crate::workers::HttpClient),
    #[cfg(feature = "spin_backend")]
    Spin(crate::spin::HttpClient),
}