Skip to main content

Arg

Enum Arg 

Source
pub enum Arg<'a> {
    ConfigFilePath(Cow<'a, str>),
    LogLevel(LogLevel),
    OutputFormat(OutputFormat),
    MultiQuery,
    Custom(Cow<'a, str>, Option<Cow<'a, str>>),
}
Expand description

Query arguments that can be passed when executing queries.

Arg represents various command-line arguments that can be used to configure query execution. Most commonly, you’ll use OutputFormat to specify the desired output format.

§Examples

use chdb_rust::arg::Arg;
use chdb_rust::format::OutputFormat;
use chdb_rust::log_level::LogLevel;

// Specify output format
let args = &[Arg::OutputFormat(OutputFormat::JSONEachRow)];

// Specify log level
let args = &[Arg::LogLevel(LogLevel::Debug)];

// Use custom arguments
let args = &[Arg::Custom("path".into(), Some("/tmp/db".into()))];

Variants§

§

ConfigFilePath(Cow<'a, str>)

--config-file=<value>

Can be used to specify a custom configuration file for the session, allowing one to configure various aspects of the session’s behavior (e.g., SSL settings to use with the remoteSecure function).

An example SSL configuration file (chdb_ssl.xml) might look like this:

<clickhouse>
  <openSSL>
    <client>
      <caConfig>path_to_server_ca_cert.pem</caConfig>
    </client>
  </openSSL>
</clickhouse>

where path_to_server_ca_cert.pem is the path to the CA certificate of the remote server.

§

LogLevel(LogLevel)

--log-level=<value>

§

OutputFormat(OutputFormat)

--output-format=<value>

§

MultiQuery

–multiquery Emitted as -n (short for --multiquery).

§

Custom(Cow<'a, str>, Option<Cow<'a, str>>)

Custom argument.

“–path=/tmp/chdb” translates into one of the following:

  1. Arg::Custom(“path”.to_string().into(), Some(“/tmp/chdb”.to_string().into())).
  2. Arg::Custom(“path”.into(), Some(“/tmp/chdb”.into())).

“–multiline” translates into one of the following:

  1. Arg::Custom(“multiline”.to_string().into(), None).
  2. Arg::Custom(“multiline”.into(), None).

Officially supported arguments can be found by running clickhouse-client --help in the terminal.

Trait Implementations§

Source§

impl<'a> Debug for Arg<'a>

Source§

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

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

impl Display for Arg<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for Arg<'a>

§

impl<'a> Freeze for Arg<'a>

§

impl<'a> Move for Arg<'a>

§

impl<'a> RefUnwindSafe for Arg<'a>

§

impl<'a> Send for Arg<'a>

§

impl<'a> Sync for Arg<'a>

§

impl<'a> Unpin for Arg<'a>

§

impl<'a> UnsafeUnpin for Arg<'a>

§

impl<'a> UnwindSafe for Arg<'a>

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.