# 使用 Homebrew, Nix 安装 sql-formatter

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

## 安装

```sh
sudo av install brew:sql-formatter
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install sql-formatter
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#sql-formatter
```

  证据: nixpkgs package indexes: pkgs/by-name/sq/sql-formatter/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:sql-formatter
- **软件包管理器:** Homebrew
- **版本:** 15.8.2
- **来源摘要:** Whitespace formatter for different query languages
- **主页:** <https://sql-formatter-org.github.io/sql-formatter/>
- **最后更新:** 2026-06-22T14:17:23Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- sql-formatter (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 15.8.2
## 项目历史与用法

SQL Formatter is a TypeScript and JavaScript library and CLI for pretty-printing SQL and related query languages.

### 项目历史

The project was created in 2016 and its README says it started as a port of a PHP library before diverging substantially. It grew into a multi-dialect formatter supporting engines and query languages including BigQuery, ClickHouse, DB2, DuckDB, Hive, MariaDB, MySQL, N1QL, Oracle PL/SQL, PostgreSQL, Redshift, Snowflake, Spark, SQLite, Transact-SQL, Trino, and others.

### 采用历史

SQL Formatter is primarily distributed through the JavaScript package ecosystem, with the README recommending npm, yarn, pnpm, or bun. The supplied package metadata also shows Homebrew and Nix packaging for the CLI, and the organization maintains an official VS Code extension.

### 使用方式

The library exposes a `format` function for applications, while the CLI installs as `sql-formatter` and can format stdin or a file. It accepts language and config options, searches for `.sql-formatter.json` in the current or parent directories, and can also use a config path or JSON string passed with `--config`.

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

Package nerds care about SQL Formatter because it is a small, installable formatting primitive that can be embedded in editors, scripts, CI, and language tooling. Its appeal is broad dialect coverage and simple package-manager installation rather than a full SQL linting framework.

### 时间线

- 2016: GitHub repository created and v0.0.1 published.
- 2026: v15.8.2 published on GitHub releases.

### Related projects

- The README credits the original PHP sql-formatter library as its starting point and links to official editor integrations, including the SQL Formatter VS Code extension.

### 来源

- GitHub API repository and releases metadata for sql-formatter-org/sql-formatter, accessed 2026-07-02
- <https://github.com/sql-formatter-org/sql-formatter>
- <https://raw.githubusercontent.com/sql-formatter-org/sql-formatter/master/package.json>
- <https://sql-formatter-org.github.io/sql-formatter/>
- input source_facts.package-manager


## 安全说明

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



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .sql-formatter.json
## 其他软件包管理器记录

- Nix - sql-formatter: normalized package name match | nixpkgs package indexes: pkgs/by-name/sq/sql-formatter/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/sql-formatter.yml](https://github.com/mxcl/pkgdb/blob/main/combined/sql-formatter.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
