5 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
sq is a command line tool that allows you to query structured data from various sources, including SQL databases and document formats like CSV and Excel. It supports joining data across different sources and outputs results in multiple formats. You can also inspect metadata, compare tables, and perform common database operations.
If you do, here's more
sq is a command line tool that merges the functionalities of SQL databases with jq-style querying, allowing users to work with structured data from various sources, including SQL databases, CSV files, and Excel spreadsheets. It supports complex operations like joining data across different formats—such as combining a CSV file with a Postgres table or an Excel workbook with MySQL. Users can execute both jq-like queries and native SQL commands, making it versatile for data manipulation.
The tool can output results in multiple formats: JSON, HTML, CSV, Markdown, and XML, and it allows the insertion of query results directly into SQL databases. Users can easily inspect data sources to view metadata, compare tables or entire databases using the sq diff command, and perform common database operations like copying, truncating, or dropping tables. Installation is straightforward via Homebrew, Scoop, or Docker, and it’s now included as a core brew formula.
To start using sq, users add data sources with simple commands. For instance, after downloading a SQLite database, one can add it with `sq add ./sakila.db` and ping it to ensure it's active. The querying syntax is flexible, enabling both jq-like and SQL commands. Users can inspect tables to find their names and export data to different formats effortlessly. The tool can also efficiently handle data operations across various source types, making it a powerful option for data wrangling and migration tasks in diverse environments, including Kubernetes.
For developers and contributors, there's a section on contributing to the project, including bug reports and feature requests. The documentation is comprehensive, covering command usage, installation options, and detailed query guides. The flexibility of sq, combined with its capability to interact with multiple data sources seamlessly, makes it a compelling choice for data professionals looking to streamline their workflows.
Questions about this article
No questions yet.