Struct clickhouse::Client
source · pub struct Client { /* private fields */ }
Expand description
A client containing HTTP pool.
Can be created by using Client::default()
or Client::with_http_client
.
Implementations§
source§impl Client
impl Client
sourcepub fn with_http_client(client: impl HttpClient) -> Self
pub fn with_http_client(client: impl HttpClient) -> Self
Creates a new client with a specified underlying HTTP client.
Now only hyper::Client
is supported.
sourcepub fn with_url(self, url: impl Into<String>) -> Self
pub fn with_url(self, url: impl Into<String>) -> Self
Specifies ClickHouse’s url. Should point to HTTP endpoint.
Examples
let client = Client::default().with_url("http://localhost:8123");
sourcepub fn with_database(self, database: impl Into<String>) -> Self
pub fn with_database(self, database: impl Into<String>) -> Self
sourcepub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
sourcepub fn with_compression(self, compression: Compression) -> Self
pub fn with_compression(self, compression: Compression) -> Self
Specifies a compression mode. See Compression
for details.
By default, Lz4
is used.
Examples
let client = Client::default().with_compression(Compression::Lz4Hc(4));
sourcepub fn with_option(
self,
name: impl Into<String>,
value: impl Into<String>
) -> Self
pub fn with_option( self, name: impl Into<String>, value: impl Into<String> ) -> Self
Used to specify options that will be passed to all queries.
Example
Client::default().with_option("allow_nondeterministic_mutations", "1");
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more