Duckman(赶鸭人) is a DuckDB version manager and toolchain CLI.
Features:
- Install/Uninstall DuckDB with different versions
- List installed/remote DuckDB
- Run duckdb with a specific version of DuckDB and profile
- Extension Manager: install/uninstall/update/migrate extensions
- Profile Manager: secrets, S3, required extensions etc.
- Snippet manager: new/edit/list snippets from
~/.duckdb/snippets - MotherDuck integration
- DuckLake integration
- Iceberg integration
- dotenv support:
.envautoload into environment variables forgetenv('XXX') - Duckman shim: a wrapper for DuckDB executable, it is used to switch DuckDB version and profile
- dotenvx-rs integration to encrypt sensitive data in duckman.toml
- Mac:
brew install linux-china/tap/duckman - Cargo:
cargo binstall duckman - Shell:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/linux-china/duckman/releases/download/v0.1.4/duckman-installer.sh | sh - PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://github.com/linux-china/duckman/releases/download/v0.1.4/duckman-installer.ps1 | iex"
Profile is a collection of settings to run DuckDB.
- basic info: name, description, DuckDB version
- settings:
setsentences from Pragmas - required extensions
- secrets
- environment variables
- S3 bucket list
- attached db
- ducklake
- parquet key
If profile name is default, and it means that this profile will be used as the default profile when running DuckDB.
Fore more information about profile, please refer Duckman Config.
- install/uninstall extension
- list extensions
- init: create a new extension with Rust/C++
DUCKDB_VERSION: default DuckDB version to useDUCKDB_PROFILE: default profile to run DuckDB
- option first:
--duckdb 1.5.2 - environment variable:
DUCKDB_VERSION - profile default:
duckdb_versionin profile - global default:
defaultin config file
Or you can create .env file with environment variables:
DUCKDB_VERSION=v1.5.2
Migration is not real one, just install the extensions on new DuckDB version.
$ duckman --duckdb 1.5.2 ext migrate 1.4.4$ unzip -d $HOME/.duckdb/versions/v1.5.2 duckdb_cli-osx-amd64.zip
$ duckman install ~/Downloads/duckdb
$ duckman install system
Create snippet Markdown file under ~/.duckdb/snippets directory, and content as following:
---
summary: Filter column names using a pattern
tags: [sql]
---
```sql
-- select only the column names that start with the dim_
SELECT COLUMNS('^dim_') FROM fact_table;
```Then use duckman snippet list or duckman snippet show <name> to list or show snippet.
- option first:
--profile xxx - environment variable:
DUCKDB_PROFILE
Or you can create .env file with environment variables:
DUCKDB_PROFILE=xxx
Duckman shim is a wrapper for DuckDB executable, it is used to switch DuckDB version and profile.
$ ln -s /path/to/duckman.shim ~/bin/duckdb
$ ~/bin/duckdb --version
[profile.analytics.environment]
MOTHERDUCK_TOKEN = "xxxx"
[profile.analytics.attached.mydb]
path = "md:mydb"Add quack extension and init_sql to start quack server.
# profile of polyglot
[profile.polyglot.quack_server]
uri = "quack:localhost"
token = "super_secret"[profile.analytics.attached.remote_db]
type = "quack"
path = "quack:localhost"
options = { TOKEN = "super_secret" }[profile.analytics.secret.iceberg_secret]
type = "iceberg"
token = "bearer_token"
[profile.analytics.attached.myberg]
type = "iceberg"
path = "warehouse"
options = { SECRET = "iceberg_secret", ENDPOINT = "https://rest_endpoint.com" }duckman snippet edit <name>: edit/create snippetduckman snippet list: list all snippetsduckman snippet show <name>: show snippet
- DuckDB: https://duckdb.org/
- DuckLake: https://ducklake.select/
- MotherDuck: https://motherduck.com/
