Compatibility
ant hasn't reached 1.0, so anything can change between releases. Any release that changes behaviour will say so in its notes.
Go
ant needs Go 1.27 or later, because its API uses generic methods. Each release supports the two newest Go versions, as Go itself does.
| Feature | Since | Used for |
|---|---|---|
iter.Seq2 | Go 1.23 | Streaming with Each |
new(expr) | Go 1.26 | Nullable values, as in user.Bio = new("text") |
| Generic methods | Go 1.27 | Join[J], Include[R], Select[R] in fluent chains |
| Field selectors as struct literal keys | Go 1.27 | User{ID: 1} for fields promoted from ant.Base |
Databases
| Database | Status |
|---|---|
| PostgreSQL 13 to 18 | Supported: the whole suite passes on each, as of 2026-11-01 |
| MySQL 8.4, MariaDB 11.8, SQLite (modernc 1.61), SQL Server 2022 | Queries and writes: the conformance suite passes. No migrations |
MERGE needs PostgreSQL 15. Everything else works from 13. ant runs on the pgx driver through database/sql. Another PostgreSQL driver may work, but pgxext needs pgx. See databases for what each one lacks.
From 1.0
ant will follow semantic versioning: patch releases fix bugs, minor releases add to the API and change nothing that exists, and major releases can break things, with notes on how to move.
The API is:
- Every exported name in the public packages, which a test keeps a record of.
- The behaviour the documentation and
tests/featuresdescribe. - The migration file format, and the history table.
The API isn't:
- Anything under
internal. - The exact SQL ant writes, which can change as long as it means the same.
- The text of error messages. Match errors with
errors.Is. - The
dialectandqbpackages, until a dialect outside this module exists to settle them.
Files that outlive a release
Migrations and snapshots stay readable. A snapshot records its format, and a newer format is refused with a clear error, not misread. The history table only gains columns.
Upgrading
- Read the notes for each release you cross.
- Update the module:
go get github.com/skudra-go/ant@latest. - Run
go build ./.... A renamed or changed API fails here, which is the point of a typed one. - Run your tests against a real database.
- Run
go run ./cmd/migrate check. A release can change how a model maps to a schema, and this shows it. - Run
go run ./cmd/migrate driftagainst a staging database.