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>

§

LogLevel(LogLevel)

--log-level=<value>

§

OutputFormat(OutputFormat)

--output-format=<value>

§

MultiQuery

–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).

We should tell user where to look for officially supported arguments. Here is some hint for now: https://github.com/fixcik/chdb-rs/blob/master/OPTIONS.md.

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

Auto Trait Implementations§

§

impl<'a> Freeze 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> UnwindSafe for Arg<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.