Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7f6b186
Catch invalid ON CONFLICT DO UPDATE column references (#4366)
nikolayk812 Apr 17, 2026
98bdb52
build(deps): bump github.com/jackc/pgx/v5 from 5.8.0 to 5.9.0 (#4377)
dependabot[bot] Apr 17, 2026
21e4c47
docs: add sqlc-gen-sqlx to community language support (#4371)
jrandolf Apr 17, 2026
ee439b8
build(deps): bump actions/upload-artifact from 6 to 7 (#4320)
dependabot[bot] Apr 17, 2026
47cb4f9
Upgrade Go toolchain to 1.26.2 (#4378)
kyleconroy Apr 17, 2026
93e1a17
Remove github.com/jackc/pgx/v4 dependency (#4379)
kyleconroy Apr 17, 2026
a2f85e2
build(deps): bump requests from 2.32.5 to 2.33.0 in /docs (#4357)
dependabot[bot] Apr 17, 2026
924c12b
build(deps): bump pygments from 2.19.2 to 2.20.0 in /docs (#4363)
dependabot[bot] Apr 17, 2026
5757d94
build(deps): bump the production-dependencies group across 1 director…
dependabot[bot] Apr 17, 2026
cff03f4
build(deps): bump the production-dependencies group across 1 director…
dependabot[bot] Apr 17, 2026
bba5fc9
Skip CI/RTD builds when the change is irrelevant (#4381)
kyleconroy Apr 17, 2026
3f41c61
Preserve MySQL optimizer hints in generated query text (#4382)
kyleconroy Apr 17, 2026
244a90b
Dedupe sqlc.arg parameters wrapped in a type cast for MySQL (#4384)
kyleconroy Apr 17, 2026
837d7c9
Coerce SQLite JSONB output regardless of type casing (#4385)
kyleconroy Apr 17, 2026
07c3808
Rename :one return variable when it conflicts with a parameter (#4383)
kyleconroy Apr 17, 2026
64d18fc
Map xid8 to pgtype.Uint64 for pgx/v5 (#4387)
kyleconroy Apr 18, 2026
9d9026b
Emit pointers for nullable enum columns when emit_pointers_for_null_t…
kyleconroy Apr 19, 2026
3e9e3d4
Upgrade github.com/pingcap/tidb/pkg/parser (#4389)
kyleconroy Apr 19, 2026
394bdc7
Strip psql meta-commands from schema files (fixes #4065) (#4390)
kyleconroy Apr 19, 2026
3e66a4a
Update CI workflow to remove paths-ignore (#4393)
kyleconroy Apr 20, 2026
420f5e7
Add changelog for 1.31.0 (#4392)
kyleconroy Apr 20, 2026
0f82157
Release 1.31.0 (#4394)
kyleconroy Apr 20, 2026
ca8dbe9
build(deps): bump github.com/jackc/pgx/v5 (#4398)
dependabot[bot] Apr 21, 2026
dadc7ed
Downgrade github.com/ncruces/go-sqlite3 to v0.32.0 (#4400)
kyleconroy Apr 21, 2026
428d4e6
Remove go.mod replace directive that breaks 'go install ...@latest' (…
kyleconroy Apr 21, 2026
b4fe67f
Add changelog for 1.31.1 (#4406)
kyleconroy Apr 22, 2026
a95e91d
Release 1.31.1 (#4407)
kyleconroy Apr 22, 2026
721a6f3
chore: rebase fork onto upstream v1.31.1; re-apply pkg/api shim
paulknebel Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ body:
description: What version of sqlc are you running? If you don't know, run `sqlc version`.
multiple: false
options:
- 1.31.1
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/buf.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: buf
on: pull_request
on:
pull_request:
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'
- name: install ./...
run: go build ./...
env:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
jobs:
build:
if: false
Expand All @@ -13,7 +19,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v6
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
jobs:
build:
if: false
Expand All @@ -13,7 +19,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v6
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- '.readthedocs.yaml'
jobs:
build:
if: false
Expand All @@ -13,7 +19,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'
- run: go build ./...
env:
CGO_ENABLED: "0"
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
go-version: '1.26.2'

- name: install gotestsum
run: go install gotest.tools/gotestsum@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
PG_PASSWORD: postgres
PG_PORT: ${{ job.services.postgres.ports['5432'] }}
- name: Save results
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: sqlc-pg-gen-results
path: gen
Expand Down
8 changes: 8 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_checkout:
# Cancel PR builds that don't touch the docs.
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml; then
exit 183
fi

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document provides essential information for working with the sqlc codebase,

### Prerequisites

- **Go 1.26.0+** - Required for building and testing
- **Go 1.26.2+** - Required for building and testing
- **Docker & Docker Compose** - Required for integration tests with databases (local development)
- **Git** - For version control

Expand Down Expand Up @@ -147,7 +147,7 @@ make start # Start database containers
### GitHub Actions Workflow

- **File:** `.github/workflows/ci.yml`
- **Go Version:** 1.26.0
- **Go Version:** 1.26.2
- **Database Setup:** Uses `sqlc-test-setup` (not Docker) to install and start PostgreSQL and MySQL directly on the runner
- **Test Command:** `gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m ./...`
- **Additional Checks:** `govulncheck` for vulnerability scanning
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# STEP 1: Build sqlc
FROM golang:1.26.1 AS builder
FROM golang:1.26.2 AS builder

COPY . /workspace
WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Riza, Inc.'

# The full version, including alpha/beta/rc tags
release = '1.30.0'
release = '1.31.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migrating-off-hosted-managed-databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ docker compose up -d

## Upgrade sqlc

You must be running sqlc v1.30.0 or greater to have access to the `servers`
You must be running sqlc v1.31.1 or greater to have access to the `servers`
configuration.

## Add servers to configuration
Expand Down
10 changes: 5 additions & 5 deletions docs/howto/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@v3
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.30.0'
sqlc-version: '1.31.1'
- run: sqlc diff
```

Expand All @@ -84,7 +84,7 @@ jobs:
- uses: actions/checkout@v3
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.30.0'
sqlc-version: '1.31.1'
# Start a PostgreSQL server
- uses: sqlc-dev/action-setup-postgres@master
with:
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- uses: actions/checkout@v3
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.30.0'
sqlc-version: '1.31.1'
- run: sqlc push
env:
SQLC_AUTH_TOKEN: ${{ secrets.SQLC_AUTH_TOKEN }}
Expand All @@ -139,7 +139,7 @@ jobs:
- uses: actions/checkout@v3
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.30.0'
sqlc-version: '1.31.1'
- uses: sqlc-dev/action-setup-postgres@master
with:
postgres-version: "16"
Expand All @@ -154,7 +154,7 @@ jobs:
steps:
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.30.0'
sqlc-version: '1.31.1'
- run: sqlc push
env:
SQLC_AUTH_TOKEN: ${{ secrets.SQLC_AUTH_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions docs/overview/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ docker run --rm -v "%cd%:/src" -w /src sqlc/sqlc generate

## Downloads

Get pre-built binaries for *v1.30.0*:
Get pre-built binaries for *v1.31.1*:

- [Linux](https://downloads.sqlc.dev/sqlc_1.30.0_linux_amd64.tar.gz)
- [macOS](https://downloads.sqlc.dev/sqlc_1.30.0_darwin_amd64.zip)
- [Windows](https://downloads.sqlc.dev/sqlc_1.30.0_windows_amd64.zip)
- [Linux](https://downloads.sqlc.dev/sqlc_1.31.1_linux_amd64.tar.gz)
- [macOS](https://downloads.sqlc.dev/sqlc_1.31.1_darwin_amd64.zip)
- [Windows](https://downloads.sqlc.dev/sqlc_1.31.1_windows_amd64.zip)

See [downloads.sqlc.dev](https://downloads.sqlc.dev/) for older versions.
67 changes: 67 additions & 0 deletions docs/reference/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,73 @@
# Changelog
All notable changes to this project will be documented in this file.

(v1-31-1)=
## [1.31.1](https://github.com/sqlc-dev/sqlc/releases/tag/v1.31.1)
Released 2026-04-22

### Bug Fixes

- Remove go.mod replace directive that breaks `go install ...@latest` (#4401)
- Downgrade github.com/ncruces/go-sqlite3 to v0.32.0 (#4400)

### Build

- (deps) Bump github.com/jackc/pgx/v5 (#4398)

(v1-31-0)=
## [1.31.0](https://github.com/sqlc-dev/sqlc/releases/tag/v1.31.0)
Released 2026-04-19

### Bug Fixes

- Strip psql meta-commands from schema files (#4390)
- Emit pointers for nullable enum columns when `emit_pointers_for_null_types` is set (#4388)
- Map xid8 to pgtype.Uint64 for pgx/v5 (#4387)
- Rename `:one` return variable when it conflicts with a parameter (#4383)
- Coerce SQLite JSONB output regardless of type casing (#4385)
- Dedupe `sqlc.arg` parameters wrapped in a type cast for MySQL (#4384)
- Preserve MySQL optimizer hints in generated query text (#4382)
- Catch invalid `ON CONFLICT DO UPDATE` column references (#4366)
- Replace manual loop with `copy()` builtin (#4166)
- (native) Make MySQL connection check immediate on first attempt (#4254)

### Documentation

- Add link to community python plugin (#4157)
- Add Claude Code remote environment setup instructions (#4246)
- Add sqlc-gen-sqlx to community language support (#4371)
- Add GitHub Topic to the plugins page (#4258)

### Features

- (sqlfile) Add `sqlfile.Split` (#4146)
- (sqlite) Add database analyzer using ncruces/go-sqlite3 (#4199)
- (ast) Implement comprehensive SQL AST formatting (#4205)
- (mysql) Improve AST formatting and add DELETE JOIN support (#4206)
- (sqlite) Add SQLite support to format tests (#4207)
- (expander) Add star expander for `SELECT *` and `RETURNING *` (PostgreSQL, MySQL, SQLite) (#4203)
- Add `SQLCEXPERIMENT` environment variable for experimental features (#4228)
- Add native database support for e2e tests without Docker (#4236)
- (postgresql) Add analyzerv2 experiment for database-only analysis (#4237)
- Graduate parsecmd experiment (#4253)
- Add parse subcommand with AST JSON output (#4240)
- Add ClickHouse support to `sqlc parse` (#4267)
- Add `sqlc-test-setup` command for database test environment setup (#4304)

### Refactor

- (ast) Rename Formatter interface to Dialect (#4208)

### Build

- Upgrade Go toolchain to 1.26.2 (#4378)
- Upgrade Go version to 1.26.0 (#4312)
- Remove github.com/jackc/pgx/v4 dependency (#4379)
- Upgrade github.com/pingcap/tidb/pkg/parser (#4389)
- Install PostgreSQL from theseus-rs/postgresql-binaries instead of apt (#4310)
- Skip CI/RTD builds when the change is irrelevant (#4381)
- (deps) 35 dependabot bumps (collapsed from individual entries)

(v1-30-0)=
## [1.30.0](https://github.com/sqlc-dev/sqlc/releases/tag/v1.30.0)
Released 2025-09-01
Expand Down
8 changes: 6 additions & 2 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ The `gen` mapping supports the following keys:
- `emit_methods_with_db_argument`:
- If true, generated methods will accept a DBTX argument instead of storing a DBTX on the `*Queries` struct. Defaults to `false`.
- `emit_pointers_for_null_types`:
- If true, generated types for nullable columns are emitted as pointers (ie. `*string`) instead of `database/sql` null types (ie. `NullString`). Currently only supported for PostgreSQL if `sql_package` is `pgx/v4` or `pgx/v5`, and for SQLite. Defaults to `false`.
- If true, generated types for nullable columns are emitted as pointers (ie. `*string`) instead of `database/sql` null types (ie. `NullString`). Currently only supported for PostgreSQL if `sql_package` is `pgx/v4` or `pgx/v5`, and for SQLite. Defaults to `false`. Nullable enum columns also follow this setting unless `emit_pointers_for_null_enum_types` is set.
- `emit_pointers_for_null_enum_types`:
- Overrides `emit_pointers_for_null_types` for nullable enum columns only. When `true`, nullable enum columns are emitted as pointers (ie. `*UserRole`). When `false`, nullable enum columns use the generated `NullUserRole` wrapper struct even if `emit_pointers_for_null_types` is true. Set this to `false` to keep the pre-v1.31 behavior when upgrading. Only applies to PostgreSQL with `sql_package` `pgx/v4` or `pgx/v5`.
- `emit_enum_valid_method`:
- If true, generate a Valid method on enum types,
indicating whether a string is a valid enum value.
Expand Down Expand Up @@ -441,7 +443,9 @@ Each mapping in the `packages` collection has the following keys:
- `emit_methods_with_db_argument`:
- If true, generated methods will accept a DBTX argument instead of storing a DBTX on the `*Queries` struct. Defaults to `false`.
- `emit_pointers_for_null_types`:
- If true and `sql_package` is set to `pgx/v4` or `pgx/v5`, generated types for nullable columns are emitted as pointers (ie. `*string`) instead of `database/sql` null types (ie. `NullString`). Defaults to `false`.
- If true and `sql_package` is set to `pgx/v4` or `pgx/v5`, generated types for nullable columns are emitted as pointers (ie. `*string`) instead of `database/sql` null types (ie. `NullString`). Defaults to `false`. Nullable enum columns also follow this setting unless `emit_pointers_for_null_enum_types` is set.
- `emit_pointers_for_null_enum_types`:
- Overrides `emit_pointers_for_null_types` for nullable enum columns only. When `true`, nullable enum columns are emitted as pointers (ie. `*UserRole`). When `false`, nullable enum columns use the generated `NullUserRole` wrapper struct even if `emit_pointers_for_null_types` is true. Set this to `false` to keep the pre-v1.31 behavior when upgrading. Only applies to PostgreSQL with `sql_package` `pgx/v4` or `pgx/v5`.
- `emit_enum_valid_method`:
- If true, generate a Valid method on enum types,
indicating whether a string is a valid enum value.
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/language-support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ PHP `lcarilla/sqlc-plugin-php-dbal`_ Beta N/A
Ruby `DaredevilOSS/sqlc-gen-ruby`_ Beta Beta Beta
Zig `tinyzimmer/sqlc-gen-zig`_ N/A Beta Beta
Python `rayakame/sqlc-gen-better-python`_ N/A Beta Beta
Rust `mathematic-inc/sqlc-gen-sqlx`_ N/A Beta N/A
[Any] `fdietze/sqlc-gen-from-template`_ Stable Stable Stable
======== ================================== =============== =============== ===============

Expand Down Expand Up @@ -53,4 +54,5 @@ Gleam `daniellionel01/parrot`_ Stable Stable S
.. _tinyzimmer/sqlc-gen-zig: https://github.com/tinyzimmer/sqlc-gen-zig
.. _daniellionel01/parrot: https://github.com/daniellionel01/parrot
.. _rayakame/sqlc-gen-better-python: https://github.com/rayakame/sqlc-gen-better-python
.. _mathematic-inc/sqlc-gen-sqlx: https://github.com/mathematic-inc/sqlc-gen-sqlx
.. _github topic: https://github.com/topics/sqlc-plugin
26 changes: 13 additions & 13 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Babel==2.17.0
Babel==2.18.0
Jinja2==3.1.6
MarkupSafe==3.0.3
Pygments==2.19.2
Sphinx==7.4.7
certifi==2026.1.4
chardet==5.2.0
Pygments==2.20.0
Sphinx==8.2.3
certifi==2026.2.25
chardet==7.4.3
commonmark==0.9.1
docutils==0.20.1
idna==3.11
imagesize==1.4.1
myst-parser==4.0.1
packaging==25.0
pyparsing==3.3.1
pytz==2025.2
requests==2.32.5
imagesize==2.0.0
myst-parser==5.0.0
packaging==26.1
pyparsing==3.3.2
pytz==2026.1.post1
requests==2.33.1
snowballstemmer==3.0.1
sphinx-favicon==1.0.1
sphinx-rtd-theme==3.0.2
sphinx-favicon==1.1.0
sphinx-rtd-theme==3.1.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
Expand Down
2 changes: 1 addition & 1 deletion examples/authors/mysql/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading