duckdb Command Examples

Command-line client for DuckDB, an in-process analytical SQL engine. More information: https://duckdb.org.

duckdb

duckdb {{path/to/dbfile}}

duckdb -c "{{SELECT * FROM 'data_source.[csv|csv.gz|json|json.gz|parquet]'}}"

duckdb -c ".read {{path/to/script.sql}}"

duckdb {{path/to/dbfile}} -cmd "{{SELECT DISTINCT * FROM tbl}}"

duckdb {{path/to/dbfile}} -init {{path/to/script.sql}}

cat {{path/to/source.csv}} | duckdb -c "{{COPY (FROM read_csv('/dev/stdin')) TO '/dev/stdout' WITH (FORMAT CSV, HEADER)}}"

duckdb -help