Update cheatsheets

This commit is contained in:
ivuorinen
2025-05-26 00:20:47 +00:00
parent adc1cd4ded
commit 7b30c71887
8 changed files with 109 additions and 11 deletions

View File

@@ -16,10 +16,14 @@ source: https://github.com/tldr-pages/tldr.git
`duckdb {{path/to/dbfile}}`
- Directly query a CSV, JSON, or Parquet file:
- Query a CSV, JSON, or Parquet file using SQL:
`duckdb -c "{{SELECT * FROM 'data_source.[csv|csv.gz|json|json.gz|parquet]'}}"`
- Directly query a CSV, JSON, or Parquet file using the `file` view:
`duckdb {{data_source.[csv|csv.gz|json|json.gz|parquet]}} -c "{{ SELECT * FROM file }}"`
- Run an SQL script:
`duckdb -f {{path/to/script.sql}}`
@@ -28,10 +32,6 @@ source: https://github.com/tldr-pages/tldr.git
`duckdb {{path/to/dbfile}} -cmd "{{SELECT DISTINCT * FROM tbl}}"`
- Run SQL queries in file on database and keep the interactive shell open:
`duckdb {{path/to/dbfile}} -init {{path/to/script.sql}}`
- Read CSV from `stdin` and write CSV to `stdout`:
`cat {{path/to/source.csv}} | duckdb -c "{{COPY (FROM read_csv('/dev/stdin')) TO '/dev/stdout' WITH (FORMAT CSV, HEADER)}}"`