# Install sqlx-cli with Homebrew, Nix, pacman, apk

Command-line utility for SQLx, the Rust SQL toolkit. Version 0.9.0 via Homebrew; verified 2026-07-04.

## Install

```sh
sudo av install brew:sqlx-cli
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install sqlx-cli
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#sqlx-cli
```

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

- pacman (92%):

```sh
sudo pacman -S sqlx-cli
```

  Evidence: Arch Linux sync databases: sqlx-cli from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- apk (92%):

```sh
sudo apk add cargo-sqlx
```

  Evidence: Alpine Linux edge package indexes: cargo-sqlx from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

## Package facts

- **Package key:** brew:sqlx-cli
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/sqlx-cli>
- **Version:** 0.9.0
- **Source summary:** Command-line utility for SQLx, the Rust SQL toolkit
- **Homepage:** <https://github.com/transact-rs/sqlx>
- **Repository:** <https://github.com/transact-rs/sqlx>
- **Upstream docs:** <https://github.com/transact-rs/sqlx#readme>
- **License:** Apache-2.0 OR MIT
- **Source archive:** <https://github.com/transact-rs/sqlx/archive/refs/tags/v0.9.0.tar.gz>
- **Last updated:** 2026-07-04T16:53:45+09:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cargo-sqlx (cli)
- sqlx (cli)
- cargo-sqlx (alias)
- sqlx (alias)

## Build dependencies

- pkgconf
- rust

## 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: 0.9.0
- Package-manager updated: 2026-07-04
- Local data: ok
- Upstream repository: https://github.com/transact-rs/sqlx
- Upstream latest detected: v0.9.0 (current)
## Project history and usage

sqlx-cli is the command-line companion to SQLx, the Rust SQL toolkit, used for database management, migrations, and offline query metadata generation.

### Project history

The SQLx repository's official README describes SQLx as an async, pure-Rust SQL crate with optional compile-time checked queries and support for PostgreSQL, MySQL, MariaDB, and SQLite. The sqlx-cli README describes the CLI as SQLx's associated command-line utility for managing databases, migrations, and offline mode for query macros.

Official repository metadata places the SQLx project in public GitHub development from late 2019. The CLI became important because SQLx's compile-time query checking creates a developer workflow need: capture query metadata with cargo sqlx prepare so projects can build without a live development database.

### Adoption history

The supplied package-manager facts show sqlx-cli distributed as sqlx-cli or cargo-sqlx through Homebrew, Alpine, Nix, and Arch. That packaging matters because Rust users often need the executable in CI images and developer shells even when the application itself depends on SQLx as a library.

### How it is used

The official sqlx-cli README documents cargo install options by database backend and TLS stack, DATABASE_URL via command-line option, environment, or .env file, database create/drop commands, migration creation and execution, reversible migrations, cargo sqlx prepare, the .sqlx metadata directory, and prepare --check for CI.

### Why package nerds care

Package nerds care about sqlx-cli because it bridges Rust's compile-time SQL checking with ordinary package-manager workflows. It is a CLI that must stay version-compatible with a Rust library, database drivers, TLS choices, and CI environments.

### Timeline

- 2019: Official repository metadata reports SQLx public repository creation.
- 2020: Public issue history shows early CLI design work around cargo-sqlx and migration commands.
- 2021: The sqlx-cli README documents reversible migrations using timestamped up/down SQL files.
- 2023: Changelog notes offline query metadata moving toward one file per query invocation.
- 2026: Latest crate/docs metadata continues to describe sqlx-cli as SQLx's command-line utility.

### Related projects

- sqlx-cli is tightly coupled to SQLx query macros, Rust's cargo workflow, and database backends including PostgreSQL, MySQL/MariaDB, and SQLite.

### Sources

- <https://docs.rs/crate/sqlx-cli/latest>
- <https://github.com/launchbadge/sqlx/issues/170>
- <https://github.com/transact-rs/sqlx>
- <https://github.com/transact-rs/sqlx/tree/main/sqlx-cli#readme>
- source_facts.package-manager


## Security Notes

broad file, network, media, or database tool signal.

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal


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


## Credential files

- Unix: .env
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** sqlx-cli
- **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 - sqlx-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/sq/sqlx-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - sqlx-cli - 0.9.0-1: normalized package name match | Arch Linux sync databases: sqlx-cli from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Command-line utility for SQLx, the Rust SQL toolkit | https://github.com/launchbadge/sqlx
- apk - cargo-sqlx - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: cargo-sqlx from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Command-line utility for SQLx, the Rust SQL toolkit - cargo subcommand | https://github.com/launchbadge/sqlx
- apk - sqlx - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: sqlx from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Command-line utility for SQLx, the Rust SQL toolkit | https://github.com/launchbadge/sqlx
- apk - sqlx-bash-completion - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: sqlx-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for sqlx | https://github.com/launchbadge/sqlx
- apk - sqlx-doc - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: sqlx-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Command-line utility for SQLx, the Rust SQL toolkit (documentation) | https://github.com/launchbadge/sqlx
- apk - sqlx-fish-completion - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: sqlx-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for sqlx | https://github.com/launchbadge/sqlx
- apk - sqlx-zsh-completion - 0.8.6-r0: installed executable or alias match | Alpine Linux edge package indexes: sqlx-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for sqlx | https://github.com/launchbadge/sqlx


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [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.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [sqlsmith](https://www.automicvault.com/pkg/brew/sqlsmith/) - Shares av.db curated category or tags: cli, databases, developer-tools, postgresql, sql.
- [dbhash](https://www.automicvault.com/pkg/brew/dbhash/) - Shares av.db curated category or tags: cli, database, developer-tools, sqlite.
- [dbmate](https://www.automicvault.com/pkg/brew/dbmate/) - Shares av.db curated category or tags: cli, database, developer-tools, mysql, postgresql.
- [dblab](https://www.automicvault.com/pkg/brew/dblab/) - Shares av.db curated category or tags: cli, database, developer-tools, mysql, postgresql.
- [fileql](https://www.automicvault.com/pkg/brew/fileql/) - Shares av.db curated category or tags: cli, developer-tools, sql.
- [fzf-make](https://www.automicvault.com/pkg/brew/fzf-make/) - Shares av.db curated category or tags: cli, developer-tools, rust.
- [git-absorb](https://www.automicvault.com/pkg/brew/git-absorb/) - Shares av.db curated category or tags: cli, developer-tools, rust.
- [halp](https://www.automicvault.com/pkg/brew/halp/) - Shares av.db curated category or tags: cli, developer-tools, rust.
- [sqlx-cli](https://www.automicvault.com/pkg/cargo/sqlx-cli/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/sqlx-cli.yml](https://github.com/automic-vault/db/blob/main/combined/sqlx-cli.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
