pub struct ConnectionBuilder { /* private fields */ }Expand description
Builder for creating ClickHouse clients with custom configuration.
This builder captures the configuration needed to create multiple ClickHouse client instances.
It exposes the same with_* methods as the clickhouse::Client struct.
Implementations§
Source§impl ConnectionBuilder
impl ConnectionBuilder
Sourcepub fn with_database(self, database: impl Into<String>) -> Self
pub fn with_database(self, database: impl Into<String>) -> Self
Sets the default database.
Sourcepub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
Sets the database password.
Sourcepub fn with_access_token(self, access_token: impl Into<String>) -> Self
pub fn with_access_token(self, access_token: impl Into<String>) -> Self
Sets the access token for authentication.
Sourcepub fn with_compression(self, compression: Compression) -> Self
pub fn with_compression(self, compression: Compression) -> Self
Sets the compression method.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a custom HTTP header.
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
Adds a ClickHouse query option.
Sourcepub fn with_roles<I>(self, roles: I) -> Self
pub fn with_roles<I>(self, roles: I) -> Self
Sets the roles for the connection.
Sourcepub fn with_default_roles(self) -> Self
pub fn with_default_roles(self) -> Self
Enables default roles for the connection.
Sourcepub fn with_product_info(
self,
product_name: impl Into<String>,
product_version: impl Into<String>,
) -> Self
pub fn with_product_info( self, product_name: impl Into<String>, product_version: impl Into<String>, ) -> Self
Sets product information for the client.
Sourcepub fn with_validation(self, enabled: bool) -> Self
pub fn with_validation(self, enabled: bool) -> Self
Enables or disables request validation.
Trait Implementations§
Source§impl Clone for ConnectionBuilder
impl Clone for ConnectionBuilder
Source§fn clone(&self) -> ConnectionBuilder
fn clone(&self) -> ConnectionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionBuilder
impl RefUnwindSafe for ConnectionBuilder
impl Send for ConnectionBuilder
impl Sync for ConnectionBuilder
impl Unpin for ConnectionBuilder
impl UnwindSafe for ConnectionBuilder
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