# Install trdsql with Homebrew, MacPorts, Nix, scoop

CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Version 1.2.3 via Homebrew; verified 2026-06-15.

## Install

```sh
sudo av install brew:trdsql
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install trdsql
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install trdsql
```

  Evidence: MacPorts ports tree: textproc/trdsql/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#trdsql
```

  Evidence: nixpkgs package indexes: pkgs/by-name/tr/trdsql/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install main/trdsql
```

  Evidence: Scoop official bucket manifest trees: bucket/trdsql.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:trdsql
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/trdsql>
- **Version:** 1.2.3
- **Source summary:** CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN
- **Homepage:** <https://noborus.github.io/trdsql/>
- **Repository:** <https://github.com/noborus/trdsql>
- **Upstream docs:** <https://github.com/noborus/trdsql#readme>
- **License:** MIT
- **Source archive:** <https://github.com/noborus/trdsql/archive/refs/tags/v1.2.3.tar.gz>
- **Last updated:** 2026-06-15T10:21:22-04:00
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- trdsql (cli)
- trdsql (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.2.3
- Package-manager updated: 2026-06-15
- Local data: ok
- Upstream repository: https://github.com/noborus/trdsql
- Upstream latest detected: v1.2.3 (current)
## Project history and usage

trdsql is a Go command-line tool for executing SQL over tabular text and semi-structured files including CSV, LTSV, JSON, YAML, and TBLN. The official README positions it near tools such as `q` and `textql`, but emphasizes that trdsql can use PostgreSQL or MySQL syntax as well as SQLite.

### Project history

Noboru Saito developed trdsql as a practical bridge between shell data files and relational query engines. The official documentation explains its internal processing as option and SQL interpretation, importing file names from SQL commands into a database, executing SQL, and exporting the result in a requested output format.

The project evolved from a text-query utility into a broader data conversion and analysis tool. The README documents direct SQL queries, file conversion mode, multiple input formats, multiple output formats, NULL handling, query files, compressed input and output, table-name shortcuts, joins, and selectable SQLite, PostgreSQL, or MySQL engines.

The author's release-history pages show a maturing project. Version 0.13.0, posted November 12, 2023, introduced a shorter `-t` table-name syntax useful for simple format conversion and addressed macOS arm64 binary builds. Version 1.0.0, posted April 8, 2024, was marked stable by the author and followed improvements such as multiple SQL execution added in v0.20.0.

### Adoption history

trdsql's adoption comes from the command-line data niche: users who have CSV, JSON, YAML, logs, or mixed tabular files but want real SQL operations without first creating a database schema. The official README documents binary downloads for Linux, Windows, and macOS, Docker usage, Go source builds, Homebrew, MacPorts, and FreeBSD packages.

The batch input records broader package-manager coverage, including Homebrew, MacPorts, Nix, and Scoop. That package spread matches the tool's cross-platform promise: a single CLI for shell users who want SQL-shaped inspection and conversion across operating systems.

### How it is used

In day-to-day use, trdsql runs SQL directly against files, reads from standard input, converts between formats with output flags, handles CSV headers and delimiters, parses JSON with jq expressions, and emits CSV, TSV, JSON, JSON Lines, LTSV, YAML, Markdown, ASCII tables, raw output, and other formats.

Its docs emphasize the tradeoff behind its power: trdsql imports data into an RDBMS before executing SQL, so it is not a streaming one-line-at-a-time filter. In exchange, users get real SQL semantics, joins, aggregation, window functions, configurable database engines, and format conversion in one package.

### Why package nerds care

For package nerds, trdsql sits in the same toolbox as `jq`, `xsv`, `mlr`, `q`, and `textql`, but it occupies the SQL-first corner. It is attractive when a user already thinks in SELECT, JOIN, GROUP BY, and database engine behavior but wants package-manager installation and shell-pipeline ergonomics.

The tool also shows the modern CLI packaging pattern: Go binary releases, Docker image, Homebrew and MacPorts formulas, Scoop availability, FreeBSD package notes, and source builds all coexist in the official installation docs.

### Timeline

- 2023: v0.13.0 release notes document `-t` table-name shorthand, macOS arm64 binary fixes, and build-environment changes.
- 2024: Official documentation site publishes trdsql overview, internals, configuration, SQL-engine, and format-conversion pages.
- 2024: v1.0.0 release notes state that the author considered trdsql stable enough for a 1.0.0 release.

### Related projects

- The README explicitly compares trdsql with `q` and `textql`.
- Related database engines include SQLite, PostgreSQL, and MySQL, which trdsql can use as execution backends.
- Related shell data tools include `jq` for JSON selection and other table/file processors used in pipelines.

### Sources

- Batch input field: source_facts.package-manager
- Official README: https://github.com/noborus/trdsql#readme
- Official docs site: https://noborus.github.io/trdsql/
- Official internals page: https://noborus.github.io/trdsql/11_summary/index.html
- Official v0.13.0 release-history page: https://noborus.github.io/trdsql_history/trdsql_0130/index.html
- Official v1.0.0 release-history page: https://noborus.github.io/trdsql_history/trdsql_1000/index.html


## Security Notes

No matching local secret-handling manifest was found for trdsql. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** trdsql
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - trdsql: normalized package name match | nixpkgs package indexes: pkgs/by-name/tr/trdsql/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - trdsql: normalized package name match | MacPorts ports tree: textproc/trdsql/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/trdsql: normalized package name match | Scoop official bucket manifest trees: bucket/trdsql.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [dasel](https://www.automicvault.com/pkg/brew/dasel/) - Shares av.db curated category or tags: cli, csv, developer-tools, json, yaml.
- [dbmate](https://www.automicvault.com/pkg/brew/dbmate/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [dbml-cli](https://www.automicvault.com/pkg/brew/dbml-cli/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [harlequin](https://www.automicvault.com/pkg/brew/harlequin/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [jet](https://www.automicvault.com/pkg/brew/jet/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [pg-schema-diff](https://www.automicvault.com/pkg/brew/pg-schema-diff/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [pgformatter](https://www.automicvault.com/pkg/brew/pgformatter/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [sql-migrate](https://www.automicvault.com/pkg/brew/sql-migrate/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [sqlbench](https://www.automicvault.com/pkg/brew/sqlbench/) - Local metadata places this package in an adjacent workflow. Shared terms: cli, database, developer, developer-tools, queries.

## Combined YAML source

View the package source record on GitHub. [combined/trdsql.yml](https://github.com/automic-vault/db/blob/main/combined/trdsql.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
