# 使用 Homebrew, MacPorts, Nix, scoop 安装 trdsql

查看 trdsql 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install trdsql
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install trdsql
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:trdsql
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/trdsql>
- **版本:** 1.2.3
- **来源摘要:** CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN
- **主页:** <https://noborus.github.io/trdsql/>
- **仓库:** <https://github.com/noborus/trdsql>
- **上游文档:** <https://github.com/noborus/trdsql#readme>
- **许可证:** MIT
- **源码归档:** <https://github.com/noborus/trdsql/archive/refs/tags/v1.2.3.tar.gz>
- **最后更新:** 2026-06-15T10:21:22-04:00
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- trdsql (cli)
- trdsql (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 1.2.3
- 管理器更新时间: 2026-06-15
- 本地数据: OK
- 上游仓库: https://github.com/noborus/trdsql
- 检测到的最新版本: v1.2.3 (当前)
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- 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


## 安全说明

没有找到 trdsql 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 源数据库详情

- **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

## 其他软件包管理器记录

- 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


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/zh-hans/pkg/brew/go/) - Build dependency declared by Homebrew.
- [dasel](https://www.automicvault.com/zh-hans/pkg/brew/dasel/) - Shares av.db curated category or tags: cli, csv, developer-tools, json, yaml.
- [dbmate](https://www.automicvault.com/zh-hans/pkg/brew/dbmate/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [dbml-cli](https://www.automicvault.com/zh-hans/pkg/brew/dbml-cli/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [harlequin](https://www.automicvault.com/zh-hans/pkg/brew/harlequin/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [jet](https://www.automicvault.com/zh-hans/pkg/brew/jet/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [pg-schema-diff](https://www.automicvault.com/zh-hans/pkg/brew/pg-schema-diff/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [pgformatter](https://www.automicvault.com/zh-hans/pkg/brew/pgformatter/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [sql-migrate](https://www.automicvault.com/zh-hans/pkg/brew/sql-migrate/) - Shares av.db curated category or tags: cli, database, developer-tools, sql.
- [sqlbench](https://www.automicvault.com/zh-hans/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)


## 来源

- 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
