mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-01 16:54:25 +00:00
Update cheatsheets
This commit is contained in:
10
tldr/duckdb
10
tldr/duckdb
@@ -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)}}"`
|
||||
|
||||
Reference in New Issue
Block a user