# Install sql-formatter with Homebrew, Nix

Whitespace formatter for different query languages. Version 15.8.2 via Homebrew; verified 2026-06-22.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

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

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

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

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

## Package facts

- **Package key:** brew:sql-formatter
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/sql-formatter>
- **Version:** 15.8.2
- **Source summary:** Whitespace formatter for different query languages
- **Homepage:** <https://sql-formatter-org.github.io/sql-formatter/>
- **Repository:** <https://github.com/sql-formatter-org/sql-formatter>
- **Upstream docs:** <https://github.com/sql-formatter-org/sql-formatter#readme>
- **License:** MIT
- **Source archive:** <https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.8.2.tgz>
- **Last updated:** 2026-06-22T14:17:23Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- sql-formatter (cli)
- sql-formatter (alias)

## Dependencies

- node

## Install behavior

- Post-install hook: not defined
- Bottle: available on all

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 15.8.2
- Package-manager updated: 2026-06-22
- Local data: ok
- Upstream repository: https://sql-formatter-org.github.io/sql-formatter/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

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

### Project history

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.

### Adoption history

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.

### How it is used

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

### Why package nerds care

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.

### Timeline

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

### Sources

- 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


## Security Notes

No matching local secret-handling manifest was found for sql-formatter. Nucleus package metadata is still published here so future coverage has a stable package 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
## Source Database Details

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

## Other Package-Manager Records

- 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


## 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.
- [node](https://www.automicvault.com/pkg/brew/node/) - Runtime dependency declared by Homebrew.
- [prettier](https://www.automicvault.com/pkg/brew/prettier/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, javascript.
- [air](https://www.automicvault.com/pkg/brew/air/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [alejandra](https://www.automicvault.com/pkg/brew/alejandra/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [astyle](https://www.automicvault.com/pkg/brew/astyle/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [black](https://www.automicvault.com/pkg/brew/black/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [cbfmt](https://www.automicvault.com/pkg/brew/cbfmt/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [darker](https://www.automicvault.com/pkg/brew/darker/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [djhtml](https://www.automicvault.com/pkg/brew/djhtml/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [sql-formatter](https://www.automicvault.com/pkg/npm/sql-formatter/) - Same normalized package name appears in another local ecosystem. Shared terms: formatter, query, sql, sql-formatter, whitespace.
- [prettierd](https://www.automicvault.com/pkg/brew/prettierd/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, code, code-formatting, developer, developer-tools.
- [sql-formatter](https://www.automicvault.com/pkg/npm/sql-formatter/) - Same normalized package name in another local ecosystem.

## Combined YAML source

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


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- 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
