Skip to main content

datafusion_ducklake_cli/
args.rs

1use std::path::PathBuf;
2
3use clap::Parser;
4
5#[derive(Clone, Debug, Parser)]
6#[command(
7    name = "ducklake-cli",
8    version,
9    about = "Run SQL against a DuckLake-aware Apache DataFusion session."
10)]
11pub struct Cli {
12    /// SQL file to run before the main command, script, stdin, or REPL.
13    #[arg(long = "init", value_name = "FILE")]
14    pub init: Vec<PathBuf>,
15
16    /// SQL to execute. May be passed more than once.
17    #[arg(
18        short = 'e',
19        long = "execute",
20        value_name = "SQL",
21        conflicts_with = "file"
22    )]
23    pub execute: Vec<String>,
24
25    /// SQL script file to execute.
26    #[arg(
27        short = 'f',
28        long = "file",
29        value_name = "FILE",
30        conflicts_with = "execute"
31    )]
32    pub file: Option<PathBuf>,
33
34    /// Continue running later batch statements after an error.
35    #[arg(long = "continue-on-error")]
36    pub continue_on_error: bool,
37
38    /// Suppress OK and timing output.
39    #[arg(short = 'q', long = "quiet")]
40    pub quiet: bool,
41
42    /// Print elapsed time for each executed statement.
43    #[arg(long = "timing")]
44    pub timing: bool,
45
46    /// Disable REPL history.
47    #[arg(long = "no-history")]
48    pub no_history: bool,
49
50    /// REPL history file. Defaults to $DUCKLAKE_CLI_HISTORY or ~/.ducklake-cli-history.
51    #[arg(long = "history-file", value_name = "FILE")]
52    pub history_file: Option<PathBuf>,
53
54    /// Object-store root to register, such as s3://bucket. May be repeated.
55    #[arg(long = "object-store-url", value_name = "URL")]
56    pub object_store_url: Vec<String>,
57
58    /// Object-store configuration key/value pair, passed to object_store.
59    #[arg(long = "object-store-config", value_name = "KEY=VALUE")]
60    pub object_store_config: Vec<String>,
61
62    /// Register the object-store URL as a local filesystem prefix.
63    #[arg(long = "object-store-local-path", value_name = "PATH")]
64    pub object_store_local_path: Option<PathBuf>,
65
66    /// S3-compatible endpoint URL.
67    #[arg(long = "s3-endpoint", value_name = "URL")]
68    pub s3_endpoint: Option<String>,
69
70    /// S3-compatible access key id.
71    #[arg(long = "s3-access-key-id", value_name = "ID")]
72    pub s3_access_key_id: Option<String>,
73
74    /// S3-compatible secret access key.
75    #[arg(long = "s3-secret-access-key", value_name = "SECRET")]
76    pub s3_secret_access_key: Option<String>,
77
78    /// S3-compatible session token.
79    #[arg(long = "s3-session-token", value_name = "TOKEN")]
80    pub s3_session_token: Option<String>,
81
82    /// S3-compatible region.
83    #[arg(long = "s3-region", value_name = "REGION")]
84    pub s3_region: Option<String>,
85
86    /// Allow HTTP for S3-compatible stores.
87    #[arg(long = "s3-allow-http", value_name = "BOOL")]
88    pub s3_allow_http: Option<bool>,
89
90    /// Use path-style S3-compatible requests.
91    #[arg(long = "s3-path-style")]
92    pub s3_path_style: bool,
93}