# 使用 Homebrew, MacPorts, Nix, pacman, scoop 安装 sqlc

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

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install sqlc
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sqlc
```

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

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

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

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

## 软件包事实

- **软件包键:** brew:sqlc
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/sqlc>
- **版本:** 1.31.1
- **来源摘要:** Generate type safe Go from SQL
- **主页:** <https://sqlc.dev/>
- **仓库:** <https://github.com/sqlc-dev/sqlc>
- **上游文档:** <https://sqlc.dev/>
- **许可证:** MIT
- **源码归档:** <https://github.com/sqlc-dev/sqlc/archive/refs/tags/v1.31.1.tar.gz>
- **最后更新:** 2026-07-26T04:03:45+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- sqlc (cli)
- sqlc (别名)

## 构建依赖

- go

## 安装行为

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

## 版本和新鲜度

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

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

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

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.

### 时间线

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

### 来源

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


## 安全说明

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

- **Geiger 风险:** blue / 中
- 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:** 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

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

- 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


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [jet](https://pkg.so/zh-hans/brew/jet/) - Shares pkgdb curated category or tags: cli, code-generation, database, developer-tools, go.
- [sqlboiler](https://pkg.so/zh-hans/brew/sqlboiler/) - Shares pkgdb curated category or tags: cli, code-generation, database, developer-tools, go.
- [sqlcmd](https://pkg.so/zh-hans/brew/sqlcmd/) - Shares pkgdb curated category or tags: cli, database, developer-tools, go.
- [protoc-gen-go](https://pkg.so/zh-hans/brew/protoc-gen-go/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, go.
- [golang-migrate](https://pkg.so/zh-hans/brew/golang-migrate/) - Shares pkgdb curated category or tags: cli, database, developer-tools, go.
- [mockery](https://pkg.so/zh-hans/brew/mockery/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, go.
- [snowflake-cli](https://pkg.so/zh-hans/brew/snowflake-cli/) - Shares pkgdb curated category or tags: cli, database, developer-tools, sql.
- [protoc-gen-go-grpc](https://pkg.so/zh-hans/brew/protoc-gen-go-grpc/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, go.
- [counterfeiter](https://pkg.so/zh-hans/brew/counterfeiter/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, code, code-generation, developer, developer-tools.

## Combined YAML source

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


## 来源

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