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:
- Arg::Custom(“path”.to_string().into(), Some(“/tmp/chdb”.to_string().into())).
- Arg::Custom(“path”.into(), Some(“/tmp/chdb”.into())).
“–multiline” translates into one of the following:
- Arg::Custom(“multiline”.to_string().into(), None).
- Arg::Custom(“multiline”.into(), None).
Officially supported arguments can be found by running
clickhouse-client --help in the terminal.