Skip to main content

Options

Struct Options 

Source
pub struct Options { /* private fields */ }
Expand description

Clickhouse connection options.

Implementations§

Source§

impl Options

Source

pub fn new<A>(addr: A) -> Self
where A: Into<Url>,

Constructs a new Options.

Source

pub fn with_setting<V>(self, name: &str, value: V, is_important: bool) -> Self
where V: Into<SettingType>,

Source

pub fn database(self, database: &str) -> Self

Database name. (defaults to default).

Source

pub fn username(self, username: &str) -> Self

User name (defaults to default).

Source

pub fn password(self, password: &str) -> Self

Access password (defaults to "").

Source

pub fn with_compression(self) -> Self

Enable LZ4 compression (compression defaults to none).

Source

pub fn compression(self, compression: Compression) -> Self

Compression of the data the client sends (defaults to none). none turns compression off in both directions. With Lz4 or Zstd the server compresses its replies with the method of its own network_compression_method setting, and the client reads either.

Source

pub fn pool_min(self, pool_min: usize) -> Self

Lower bound of opened connections for Pool (defaults to 10).

Source

pub fn pool_max(self, pool_max: usize) -> Self

Upper bound of opened connections for Pool (defaults to 20).

Source

pub fn nodelay(self, nodelay: bool) -> Self

Whether to enable TCP_NODELAY (defaults to true).

Source

pub fn keepalive(self, keepalive: Option<Duration>) -> Self

TCP keep alive timeout in milliseconds (defaults to None).

Source

pub fn ping_before_query(self, ping_before_query: bool) -> Self

Ping server every time before execute any query. (defaults to true).

Source

pub fn send_retries(self, send_retries: usize) -> Self

Count of retry to send request to server. (defaults to 3).

Source

pub fn retry_timeout(self, retry_timeout: Duration) -> Self

Amount of time to wait before next retry. (defaults to 5 sec).

Source

pub fn ping_timeout(self, ping_timeout: Duration) -> Self

Timeout for ping (defaults to 500 ms).

Source

pub fn connection_timeout(self, connection_timeout: Duration) -> Self

Timeout for connection (defaults to 500 ms).

Source

pub fn query_timeout(self, query_timeout: Duration) -> Self

Timeout for query (defaults to 180,000 ms).

Source

pub fn insert_timeout(self, insert_timeout: Option<Duration>) -> Self

Timeout for insert (defaults to 180,000 ms).

Source

pub fn execute_timeout(self, execute_timeout: Option<Duration>) -> Self

Timeout for execute (defaults to 180 sec).

Source

pub fn secure(self, secure: bool) -> Self

Establish secure connection (default is false).

Source

pub fn skip_verify(self, skip_verify: bool) -> Self

Skip certificate verification (default is false).

Source

pub fn certificate(self, certificate: Option<Certificate>) -> Self

An X509 certificate.

Source

pub fn settings(self, settings: HashMap<String, SettingValue>) -> Self

Query settings

Source

pub fn alt_hosts(self, alt_hosts: Vec<Url>) -> Self

Comma separated list of single address host for load-balancing.

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Options

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FromStr for Options

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(url: &str) -> Result<Self>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Options

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Options

Auto Trait Implementations§

§

impl Forget for Options

§

impl Freeze for Options

§

impl Move for Options

§

impl RefUnwindSafe for Options

§

impl Send for Options
where RawVecInner: Send, Arc<Vec<CertificateDer<'static>>>: Send, RawTable<(String, SettingValue)>: Send,

§

impl Sync for Options
where RawVecInner: Sync, Arc<Vec<CertificateDer<'static>>>: Sync, RawTable<(String, SettingValue)>: Sync,

§

impl Unpin for Options
where *const u8 is !null: Unpin, Arc<Vec<CertificateDer<'static>>>: Unpin,

§

impl UnsafeUnpin for Options

§

impl UnwindSafe for Options

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.