Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A typed ORM for Go. Plain structs, compiler-checked queries, no code generation.
Documentation · Quick start · Choose your path · Examples · Blog
Columns are field pointers, not strings. Write ant.Gt(&Users.Age, 18) and the compiler checks both the column and the value. Rename a field and every query follows.
type User struct {
ant.Base // ID, CreatedAt, UpdatedAt
Name string
Age int
Posts []Post // 1:N through Post.UserID
}
type Post struct {
ant.Base
UserID int64
Title string
}
type AppDB struct {
ant.Context
Users ant.Table[User]
Posts ant.Table[Post]
}
var Users = ant.Fields[User]()
db, err := ant.Open[AppDB](ctx, postgres.Dialect, dsn) // shared: reads and inserts, no tracking
session := ant.Session(db) // one per request: it tracks what it loads, for SaveChanges
adults, err := session.Users.
Where(ant.Gt(&Users.Age, 18)). // ant.Gt(&Users.Age, "18") won't compile
Include(&Users.Posts). // one batched query, not one per user
All(ctx)
adults[0].Age++
err = session.SaveChanges(ctx) // writes only the columns that changed
https://github.com/user-attachments/assets/718a63de-dfe2-4749-a923-51e79dd53a2a
go get github.com/skudra-go/ant
go get github.com/jackc/pgx/v5/stdlib # or the driver for your database
Requires Go 1.27 or later, for generic methods.
hello is one file on SQLite. It needs only Go:
go run github.com/skudra-go/ant-examples/examples/hello@latest
Created Alice
Alice is 30 and has 2 posts
Happy birthday, Alice
The first run takes about 30 seconds, mostly compiling the SQLite driver. To read or change the code, clone ant-examples and run go run . in examples/hello. The quick start walks through the same program.
The same query in each: users over 18 with their posts, sorted by name, 10 at a time. A test checks that all four return the same rows.
|
ant: checked, with nothing generated
|
GORM 1.31: strings, so a typo fails at run time
|
|
Bun 1.3: strings, so a typo fails at run time
|
ent 0.14: checked, through generated code
|
| Mistake | ant | GORM | Bun | ent | sqlc |
|---|---|---|---|---|---|
Misspelled column, agee | ✅ | ❌ | ❌ | ✅ | ⚠️ |
"18" for an int | ✅ | ❌ | ❌ | ✅ | ✅ |
Misspelled relation, Psots | ✅ | ❌ | ❌ | ✅ | ⚠️ |
| Column of another model | ⚠️ | ❌ | ❌ | ✅ | ⚠️ |
| No code generation step | ✅ | ✅ | ✅ | – | – |
✅ compile error ⚠️ caught by a separate step (sqlc generate, or antvet for ant) ❌ compiles, fails at run time – needs a generate step
Each cell was tested by compiling the mistake. GORM also has an optional CLI that generates typed field helpers.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground