DEV.co
Open-Source Databases · neilotoole

sq

sq is a CLI tool that lets you query SQL databases, CSV, Excel, and JSON files using jq-like syntax or native SQL. It unifies access to multiple data source types and supports joining across them, with output to JSON, CSV, Excel, Markdown, XML, and HTML.

Source: GitHub — github.com/neilotoole/sq
2.5k
GitHub stars
40
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryneilotoole/sq
Ownerneilotoole
Primary languageGo
LicenseMIT — OSI-approved
Stars2.5k
Forks40
Open issues74
Latest releasev0.54.1 (2026-06-23)
Last updated2026-07-07
Sourcehttps://github.com/neilotoole/sq

What sq is

Written in Go, sq provides a unified driver abstraction layer supporting 13+ data source types (SQLite, Postgres, MySQL, SQL Server, Oracle, DuckDB, ClickHouse, CSV, TSV, JSON, JSONL, JSONA, XLSX). It executes both declarative jq-style queries and native SQL, with cross-source join capability and metadata inspection.

Quickstart

Get the sq source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/neilotoole/sq.gitcd sq# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Ad-hoc data exploration and transformation

Quickly inspect and query CSV, Excel, or database files from the command line without writing boilerplate. jq-style syntax reduces friction for interactive analysis.

Cross-source data joins and ETL workflows

Join a CSV to a Postgres table or combine MySQL with Excel in a single query. Useful for data integration tasks where sources are heterogeneous.

Scripted database operations and reporting

Automate table inspection, copying, diffing, and export to multiple formats. Integrates well into CI/CD pipelines and data migration workflows.

Implementation considerations

  • Install via brew (macOS), curl (Linux), scoop (Windows), or go install. Docker image available for containerized environments and Kubernetes.
  • Sources are registered locally via 'sq add' with a handle; credentials are stored locally (review security model for sensitive environments).
  • Drivers are composable; not all features (e.g., cross-source joins) may be equally mature across all driver combinations—test your specific workflow.
  • Query syntax is jq-inspired but not identical; refer to sq.io documentation to avoid assuming full jq compatibility.
  • Output formats (JSON, CSV, Excel, Markdown, XML, HTML) are well-supported; insertion into databases is documented but should be tested for your target DB.

When to avoid it — and what to weigh

  • Real-time streaming or high-throughput analytics — sq is a CLI tool designed for interactive queries and scripted workflows, not a streaming engine or OLAP database optimized for massive concurrent loads.
  • Complex multi-tenant SaaS backend — sq is not a server application with auth/RBAC; it's a user-facing CLI. Not designed as a replacement for application query layers or service APIs.
  • Offline-first or embedded data access — sq requires connectivity to source systems (databases, remote files). No built-in offline caching or embedded datastore mode for disconnected operation.
  • Highly proprietary or closed data formats — Limited to supported drivers. Custom or vendor-specific formats require additional work to integrate.

License & commercial use

MIT License. Permissive OSI-approved license. No copyleft restrictions; commercial use, modification, and private use are allowed. See CONTRIBUTING.md and LICENSE for details.

MIT is a permissive license with no restrictions on commercial use. However, as with any open-source tool, verify your own compliance obligations, consult legal if needed, and note that the maintainer offers no commercial SLA or support guarantee embedded in the license.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

sq is a client-side CLI tool. Security depends on: (1) how source credentials are stored locally (not encrypted by default—review for sensitive data), (2) TLS/auth config of remote databases, (3) file permissions on local CSV/Excel inputs. No built-in encryption of query logs or outputs. Suitable for trusted developer environments; not for untrusted multi-user systems without additional hardening.

Alternatives to consider

duckdb (CLI + library)

Also supports multiple data formats and SQL; more optimized for analytics. Lacks jq-style query syntax and cross-source joins out-of-box. Consider if you need pure SQL + performance over ease-of-use.

jq + shell scripting

Minimal dependency; pure JSON wrangling. Less suitable for SQL databases or structured joins. Requires more manual glue code.

Pandas (Python) + Jupyter

Richer data transformation and visualization. Higher learning curve and requires Python runtime. Better for exploratory analysis than automation.

Software development agency

Build on sq with DEV.co software developers

Test sq on your own data sources. Start with 'sq add' and 'sq inspect' to understand integration effort, then assess whether jq-style queries or cross-source joins add value for your team.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

sq FAQ

Can I use sq to join a CSV to a Postgres table?
Yes. Register both as sources with 'sq add', then use sq's query syntax or native SQL to cross-join them. Documented in the cross-source joins guide.
Is sq suitable for production data pipelines?
Partially. It excels at scripted one-off tasks and migrations. For continuous, high-throughput pipelines, consider a dedicated orchestrator (Airflow, dbt) or stream processor (Kafka, Flink).
How does sq store database credentials?
Credentials are stored in a local config file (not encrypted by default). For sensitive environments, use environment variables or external secret management and review the docs.
Does sq modify source data by default?
No; queries are read-only by default. Write operations (insert, truncate, drop) require explicit commands. Always test in non-prod first.

Work with a software development agency

Need help beyond evaluating sq? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.

Evaluate sq for your data wrangling workflow

Test sq on your own data sources. Start with 'sq add' and 'sq inspect' to understand integration effort, then assess whether jq-style queries or cross-source joins add value for your team.