datafusion-ducklake-cli 0.1.0

Interactive and scriptable SQL shell for datafusion-ducklake-provider.
Documentation
use std::path::PathBuf;

use clap::Parser;

#[derive(Clone, Debug, Parser)]
#[command(
    name = "ducklake-cli",
    version,
    about = "Run SQL against a DuckLake-aware Apache DataFusion session."
)]
pub struct Cli {
    /// SQL file to run before the main command, script, stdin, or REPL.
    #[arg(long = "init", value_name = "FILE")]
    pub init: Vec<PathBuf>,

    /// SQL to execute. May be passed more than once.
    #[arg(
        short = 'e',
        long = "execute",
        value_name = "SQL",
        conflicts_with = "file"
    )]
    pub execute: Vec<String>,

    /// SQL script file to execute.
    #[arg(
        short = 'f',
        long = "file",
        value_name = "FILE",
        conflicts_with = "execute"
    )]
    pub file: Option<PathBuf>,

    /// Continue running later batch statements after an error.
    #[arg(long = "continue-on-error")]
    pub continue_on_error: bool,

    /// Suppress OK and timing output.
    #[arg(short = 'q', long = "quiet")]
    pub quiet: bool,

    /// Print elapsed time for each executed statement.
    #[arg(long = "timing")]
    pub timing: bool,

    /// Disable REPL history.
    #[arg(long = "no-history")]
    pub no_history: bool,

    /// REPL history file. Defaults to $DUCKLAKE_CLI_HISTORY or ~/.ducklake-cli-history.
    #[arg(long = "history-file", value_name = "FILE")]
    pub history_file: Option<PathBuf>,

    /// Object-store root to register, such as s3://bucket. May be repeated.
    #[arg(long = "object-store-url", value_name = "URL")]
    pub object_store_url: Vec<String>,

    /// Object-store configuration key/value pair, passed to object_store.
    #[arg(long = "object-store-config", value_name = "KEY=VALUE")]
    pub object_store_config: Vec<String>,

    /// Register the object-store URL as a local filesystem prefix.
    #[arg(long = "object-store-local-path", value_name = "PATH")]
    pub object_store_local_path: Option<PathBuf>,

    /// S3-compatible endpoint URL.
    #[arg(long = "s3-endpoint", value_name = "URL")]
    pub s3_endpoint: Option<String>,

    /// S3-compatible access key id.
    #[arg(long = "s3-access-key-id", value_name = "ID")]
    pub s3_access_key_id: Option<String>,

    /// S3-compatible secret access key.
    #[arg(long = "s3-secret-access-key", value_name = "SECRET")]
    pub s3_secret_access_key: Option<String>,

    /// S3-compatible session token.
    #[arg(long = "s3-session-token", value_name = "TOKEN")]
    pub s3_session_token: Option<String>,

    /// S3-compatible region.
    #[arg(long = "s3-region", value_name = "REGION")]
    pub s3_region: Option<String>,

    /// Allow HTTP for S3-compatible stores.
    #[arg(long = "s3-allow-http", value_name = "BOOL")]
    pub s3_allow_http: Option<bool>,

    /// Use path-style S3-compatible requests.
    #[arg(long = "s3-path-style")]
    pub s3_path_style: bool,
}