Skip to content
Queria Docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Connect from the Queria CLI

Find datasets, run SQL and save results to files with the Queria CLI

The Queria CLI is Queria’s command-line tool (the command is queria). When your SQL names <dataset>.<schema>.<table>, the CLI connects to that dataset for you, so you don’t write ATTACH yourself.

Try it

With uv installed, you can run it with uvx without installing it.

uvx queria search population
uvx queria sql "
  SELECT DISTINCT area_name, value AS population
  FROM e_stat.ssds.a_pref_population
  WHERE item_name = 'A1101_総人口' AND year = 2024 AND area_name != '全国'
  ORDER BY value DESC LIMIT 10
"

To save the results to a file, add --out. The file extension sets the format.

uvx queria sql "SELECT * FROM zipcode.main.mart_zipcode" --out zipcodes.parquet

How it differs from the other connection methods

  • With the DuckDB CLI or Python, you copy the connection URL and write ATTACH. The Queria CLI needs neither
  • queria list, search, schema and columns let you look up datasets, tables and columns in the terminal before writing SQL
  • SQL runs on DuckDB, so DuckDB SQL works as is, including JOINs across datasets

Was this page helpful?