# Install sqlc with Homebrew, MacPorts, Nix, pacman, scoop

Generate type safe Go from SQL. Version 1.31.1 via Homebrew; verified 2026-04-22.

## Install

```sh
sudo av install brew:sqlc
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install sqlc
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sqlc
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#sqlc
```

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

- pacman (92%):

```sh
sudo pacman -S sqlc
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/sqlc
```

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

## Package facts

- **Package key:** brew:sqlc
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/sqlc>
- **Version:** 1.31.1
- **Source summary:** Generate type safe Go from SQL
- **Homepage:** <https://sqlc.dev/>
- **Repository:** <https://github.com/sqlc-dev/sqlc>
- **Upstream docs:** <https://docs.sqlc.dev/en/stable>
- **License:** MIT
- **Source archive:** <https://github.com/sqlc-dev/sqlc/archive/refs/tags/v1.31.1.tar.gz>
- **Last updated:** 2026-04-22T16:58:03Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- sqlc (cli)
- sqlc (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.31.1
- Package-manager updated: 2026-04-22
- Local data: ok
- Upstream repository: https://github.com/sqlc-dev/sqlc
- Upstream latest detected: v1.31.1 (current)
## Project history and usage

sqlc is a command-line SQL compiler that generates type-safe application code from handwritten SQL queries. It began in the Go ecosystem and later expanded its generator model beyond Go.

### Project history

The sqlc repository was created in 2019. Its first public GitHub release, v0.1.0, appeared in January 2020, followed by v1.0.0 in February 2020.

The project documentation now describes a configuration-driven compiler with support for PostgreSQL, MySQL, and SQLite inputs, plus generator plugins for languages beyond the original Go target.

### Adoption history

sqlc found a niche among developers who wanted to keep SQL as the source of truth while avoiding hand-written row scanning and fragile stringly typed database code. The input package metadata lists Homebrew, MacPorts, Nix, Arch, and Scoop packaging, showing broad CLI distribution across Unix-like and Windows package-manager ecosystems.

### How it is used

A common workflow is to write schema and query SQL files, configure them in sqlc.yaml, sqlc.yml, or sqlc.json, and run sqlc to produce typed query methods used by application code.

### Why package nerds care

Package nerds care about sqlc because it turns SQL into a build-time artifact. It fits neatly into reproducible developer environments, CI checks, and generated-code workflows without requiring a running ORM runtime.

### Timeline

- 2019: GitHub repository created.
- 2020: v0.1.0 released.
- 2020: v1.0.0 released.
- Current docs: configuration centers on sqlc.(yaml|yml) or sqlc.json and supports plugins and multiple language targets.

### Related projects

- The SQLBoiler README lists sqlc as an alternative for users who want type-safe SQL-generated code without an ORM model. sqlc's own README lists sqlc-gen-go, sqlc-gen-kotlin, sqlc-gen-python, and sqlc-gen-typescript as supported language generator projects.

### Sources

- <https://api.github.com/repos/sqlc-dev/sqlc>
- <https://api.github.com/repos/sqlc-dev/sqlc/releases>
- <https://docs.sqlc.dev/en/stable/reference/config.html>
- <https://github.com/sqlc-dev/sqlc#readme>
- input.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.


## Configuration files

- Unix: sqlc.yaml, sqlc.yml, sqlc.json
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** sqlc
- **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 - sqlc: normalized package name match | nixpkgs package indexes: pkgs/by-name/sq/sqlc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - sqlc - 1.31.1-1: normalized package name match | Arch Linux sync databases: sqlc from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Compile SQL to type-safe Go | https://sqlc.dev
- MacPorts - sqlc: normalized package name match | MacPorts ports tree: devel/sqlc/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/sqlc: normalized package name match | Scoop official bucket manifest trees: bucket/sqlc.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Related links

- [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.
- [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.
- [sqlboiler](https://www.automicvault.com/pkg/brew/sqlboiler/) - Shares av.db curated category or tags: cli, code-generation, database, developer-tools, go.
- [jet](https://www.automicvault.com/pkg/brew/jet/) - Shares av.db curated category or tags: cli, code-generation, database, developer-tools, go.
- [counterfeiter](https://www.automicvault.com/pkg/brew/counterfeiter/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, go.
- [dbml-cli](https://www.automicvault.com/pkg/brew/dbml-cli/) - Shares av.db curated category or tags: cli, code-generation, database, developer-tools, sql.
- [go-bindata](https://www.automicvault.com/pkg/brew/go-bindata/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, go.
- [goctl](https://www.automicvault.com/pkg/brew/goctl/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, go.
- [golang-migrate](https://www.automicvault.com/pkg/brew/golang-migrate/) - Shares av.db curated category or tags: cli, database, developer-tools, go.
- [gomodifytags](https://www.automicvault.com/pkg/brew/gomodifytags/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, go.

## Combined YAML source

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