mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-07 23:26:00 +02:00
duckdb: add direct querying option (#16564)
This commit is contained in:
parent
969da941ae
commit
f42b9da9b6
1 changed files with 5 additions and 5 deletions
|
@ -11,10 +11,14 @@
|
|||
|
||||
`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}}`
|
||||
|
@ -23,10 +27,6 @@
|
|||
|
||||
`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)}}"`
|
||||
|
|
Loading…
Add table
Reference in a new issue