NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules · #160 by repository stars
Last release 19 days ago
13 Sep 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 13 of 13 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
336 releases · first in 2023
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
(codegen) Use derived ArrayDims instead of deprecated attndims
You can add tags when pushing schema and queries to sqlc Cloud. Tags operate like git tags, meaning you can overwrite previously-pushed tag values. We suggest tagging pushes to associate them with something relevant from your environment, e.g. a git tag or branch name.
$ sqlc push --tag v1.0.0
Once you've created a tag, you can refer to it when verifying changes, allowing you
to compare the existing schema against a known set of previous queries.
$ sqlc verify --against v1.0.0
cgoOver the last month, we've switched out a few different modules to remove our reliance on cgo. Previously, we needed cgo for three separate functions:
With the help of the community, we found cgo-free alternatives for each module:
For the first time, Windows users can enjoy full PostgreSQL support without using WSL. It's a Christmas miracle!
If you run into any issues with the updated dependencies, please open an issue.
name annotation (#3072)"strings" for sqlc.slice() with pgx (#3073)push, add Go plugin link (#3023)emit_sql_as_comment option to Go code plugin (#2735)Full Changelog: v1.24.0...v1.25.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
There, we run the queries for your latest push against your new schema changes. This check catches backwards incompatible schema changes for existing…
Schema updates and poorly-written queries often bring down production databases. That’s bad.
Out of the box, sqlc generate catches some of these issues. Running sqlc vet with the sqlc/db-prepare rule catches more subtle problems. But there is a large class of issues that sqlc can’t prevent by looking at current schema and queries alone.
For instance, when a schema change is proposed, existing queries and code running in production might fail when the schema change is applied. Enter sqlc verify, which analyzes existing queries against new schema changes and errors if there are any issues.
Let's look at an example. Assume you have these two tables in production.
CREATE TABLE users (
id UUID PRIMARY KEY
);
CREATE TABLE user_actions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL,
action TEXT,
created_at TIMESTAMP
);Your application contains the following query to join user actions against the users table.
-- name: GetUserActions :many
SELECT * FROM users u
JOIN user_actions ua ON u.id = ua.user_id
ORDER BY created_at;So far, so good. Then assume you propose this schema change:
ALTER TABLE users ADD COLUMN created_at TIMESTAMP;Running sqlc generate fails with this change, returning a column reference "created_at" is ambiguous error. You update your query to fix the issue.
-- name: GetUserActions :many
SELECT * FROM users u
JOIN user_actions ua ON u.id = ua.user_id
ORDER BY u.created_at;While that change fixes the issue, there's a production outage waiting to happen. When the schema change is applied, the existing GetUserActions query will begin to fail. The correct way to fix this is to deploy the updated query before applying the schema migration.
It ensures migrations are safe to deploy by sending your current schema and queries to sqlc cloud. There, we run the queries for your latest push against your new schema changes. This check catches backwards incompatible schema changes for existing queries.
Here sqlc verify alerts you to the fact that ORDER BY "created_at" is ambiguous.
$ sqlc verify
FAIL: app query.sql
=== Failed
=== FAIL: app query.sql GetUserActions
ERROR: column reference "created_at" is ambiguous (SQLSTATE 42702)By the way, this scenario isn't made up! It happened to us a few weeks ago. We've been happily testing early versions of verify for the last two weeks and haven't had any issues since.
This type of verification is only the start. If your application is deployed on-prem by your customers, verify could tell you if it's safe for your customers to rollback to an older version of your app, even after schema migrations have been run.
upload command to pushWe've renamed the upload sub-command to push. We changed the data sent along in a push request. Upload used to include the configuration file, migrations, queries, and all generated code. Push drops the generated code in favor of including the plugin.GenerateRequest, which is the protocol buffer message we pass to codegen plugins.
We also add annotations to each push. By default, we include these environment variables if they are present:
GITHUB_REPOSITORY
GITHUB_REF
GITHUB_REF_NAME
GITHUB_REF_TYPE
GITHUB_SHA
Like upload, push should be run when you tag a release of your application. We run it on every push to main, as we continuously deploy those commits.
createdbThe createdb command, added in the last release, now supports MySQL. If you have a cloud project configured, you can use sqlc createdb to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the managed databases documentation.
This release includes a refactored plugin interface to better support future functionality. Plugins now support different methods via a gRPC service interface, allowing plugins to support different functionality in a backwards-compatible way.
By using gRPC interfaces, we can even (theoretically) support remote plugins, but that's something for another day.
Full Changelog: v1.23.0...v1.24.0
Released 2023-11-22
Schema updates and poorly-written queries often bring down production databases. That’s bad.
Out of the box, sqlc generate catches some of these issues. Running sqlc vet with the sqlc/db-prepare rule catches more subtle problems. But there is a large class of issues that sqlc can’t prevent by looking at current schema and queries alone.
For instance, when a schema change is proposed, existing queries and code running in production might fail when the schema change is applied. Enter sqlc verify, which analyzes existing queries against new schema changes and errors if there are any issues.
Let's look at an example. Assume you have these two tables in production.
CREATE TABLE users (
id UUID PRIMARY KEY
);
CREATE TABLE user_actions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL,
action TEXT,
created_at TIMESTAMP
);
Your application contains the following query to join user actions against the users table.
-- name: GetUserActions :many
SELECT * FROM users u
JOIN user_actions ua ON u.id = ua.user_id
ORDER BY created_at;
So far, so good. Then assume you propose this schema change:
ALTER TABLE users ADD COLUMN created_at TIMESTAMP;
Running sqlc generate fails with this change, returning a column reference "created_at" is ambiguous error. You update your query to fix the issue.
-- name: GetUserActions :many
SELECT * FROM users u
JOIN user_actions ua ON u.id = ua.user_id
ORDER BY u.created_at;
While that change fixes the issue, there's a production outage waiting to happen. When the schema change is applied, the existing GetUserActions query will begin to fail. The correct way to fix this is to deploy the updated query before applying the schema migration.
It ensures migrations are safe to deploy by sending your current schema and queries to sqlc cloud. There, we run the queries for your latest push against your new schema changes. This check catches backwards incompatible schema changes for existing queries.
Here sqlc verify alerts you to the fact that ORDER BY "created_at" is ambiguous.
$ sqlc verify
FAIL: app query.sql
=== Failed
=== FAIL: app query.sql GetUserActions
ERROR: column reference "created_at" is ambiguous (SQLSTATE 42702)
By the way, this scenario isn't made up! It happened to us a few weeks ago. We've been happily testing early versions of verify for the last two weeks and haven't had any issues since.
This type of verification is only the start. If your application is deployed on-prem by your customers, verify could tell you if it's safe for your customers to rollback to an older version of your app, even after schema migrations have been run.
upload command to pushWe've renamed the upload sub-command to push. We changed the data sent along in a push request. Upload used to include the configuration file, migrations, queries, and all generated code. Push drops the generated code in favor of including the plugin.GenerateRequest, which is the protocol buffer message we pass to codegen plugins.
We also add annotations to each push. By default, we include these environment variables if they are present:
GITHUB_REPOSITORY
GITHUB_REF
GITHUB_REF_NAME
GITHUB_REF_TYPE
GITHUB_SHA
Like upload, push should be run when you tag a release of your application. We run it on every push to main, as we continuously deploy those commits.
createdbThe createdb command, added in the last release, now supports MySQL. If you have a cloud project configured, you can use sqlc createdb to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the managed databases documentation.
This release includes a refactored plugin interface to better support future functionality. Plugins now support different methods via a gRPC service interface, allowing plugins to support different functionality in a backwards-compatible way.
By using gRPC interfaces, we can even (theoretically) support remote plugins, but that's something for another day.
(v1-23-0)=
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
refactor(codegen): Removed deprecated code and improved speed by @quenbyako in #2899
With a database connection configured, sqlc generate will gather metadata from that database to support its query analysis. Turning this on resolves a large number of issues in the backlog related to type inference and more complex queries. The easiest way to try it out is with managed databases.
The database-backed analyzer currently supports PostgreSQL, with MySQL and SQLite support planned in the future.
createdb commandWhen you have a cloud project configured, you can use the new sqlc createdb command to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the managed databases documentation.
If you're using pgvector, say goodbye to custom overrides! sqlc now generates code using pgvector-go as long as you're using pgx. The pgvector extension is also available in managed databases.
With the new emit_build_tags configuration parameter you can set build tags for sqlc to add at the top of generated source files.
database config in all cases by @andrewmbenton in #2856CommentSyntax on windows by @andrewmbenton in #2867Full Changelog: v1.22.0...v1.23.0
Released 2023-10-24
With a database connection configured, sqlc generate
will gather metadata from that database to support its query analysis.
Turning this on resolves a large number of
issues
in the backlog related to type inference and more complex queries. The easiest
way to try it out is with managed databases.
The database-backed analyzer currently supports PostgreSQL, with MySQL and SQLite support planned in the future.
createdb commandWhen you have a cloud project configured, you can use the new sqlc createdb
command to spin up a new ephemeral database with your schema and print its
connection string to standard output. This is useful for integrating with other
tools. Read more in the managed
databases documentation.
If you're using pgvector, say goodbye to custom overrides! sqlc now generates code using pgvector-go as long as you're using pgx. The pgvector extension is also available in managed databases.
With the new emit_build_tags configuration parameter you can set build tags
for sqlc to add at the top of generated source files.
database config in all cases (#2856)CommentSyntax on windows (#2867)(v1-22-0)=
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
If you're using sqlc vet to write rules that require access to a running database, sqlc can now start and manage that database for you. PostgreSQL sup
Released 2023-09-26
sqlc vetIf you're using sqlc vet to write rules that require access to a running
database, sqlc can now start and manage that database for you. PostgreSQL
support is available today, with MySQL on the way.
When you turn on managed databases, sqlc will use your schema to create a
template database that it can copy to make future runs of sqlc vet very
performant.
This feature relies on configuration obtained via sqlc Cloud.
Read more in the managed databases documentation.
(v1-21-0)=
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →