release notes — January 4, 2024

Removing our cgo dependency in v1.25.0

sqlc is a command line tool that generates type-safe code from SQL. Today we released sqlc v1.25.0, a smaller release that removes our reliance on cgo.

What’s new

C-ya, cgo

Over the last month we’ve updated 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 cgofree 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 these updated dependencies, please open an issue.

Add tags to push and verify

You can now 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 schema changes, allowing you to verify that a new schema works with a specific set of previous queries.

$ sqlc verify --against v1.0.0

Codegen for any parsable SQL statement

We removed the gate that prevented sqlc from generating code for “unsupported” query types. In theory this means you can generate code for any parsable SQL statement, and in particular sqlc will now give you codegen output for DDL statements like CREATE TABLE .... In practice there are still many parsable SQL statements that sqlc doesn’t know how to analyze, and sqlc may panic when it encounters them. So use caution and please report any issues you find.

And more…

There were more than 20 substantive features and bug fixes included in this release, including several contributions from first-time contributors. The full list of changes is in the sqlc changelog.

< All posts