[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-117271":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":14,"stars30d":14,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":10,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":36,"discoverSource":37},117271,"ant","skudra-go\u002Fant","skudra-go","🐜 ant is a Golang ORM, that leverages modern generics to enable strict typing and incredible developer experience. Inspired by ASP.NET's Entity Framework and Laravel","https:\u002F\u002Fskudra.net",null,"Go",58,8,2,39,0,1,4,46.06,"MIT License",false,"main",[24,25,26,27,28,29,30,31,32],"database","generics","go","golang","mysql","orm","postgresql","sqlite","type-safe","2026-11-23 20:03:06","2026-11-22 17:27:41","\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Flogo-dark.svg\">\n    \u003Cimg src=\"docs\u002Fassets\u002Flogo.svg\" alt=\"ant\" width=\"220\">\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  A typed ORM for Go. Plain structs, compiler-checked queries, no code generation.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fskudra.net\">Documentation\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fskudra.net\u002Fquick-start\">Quick start\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant-examples\">Examples\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant\u002Factions\u002Fworkflows\u002Fpr-ci.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant\u002Factions\u002Fworkflows\u002Fpr-ci.yml\u002Fbadge.svg?branch=main\" alt=\"CI\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fskudra-go\u002Fant\">\u003Cimg src=\"https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Fskudra-go\u002Fant.svg\" alt=\"Go Reference\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fgo-1.27%2B-00ADD8\" alt=\"Go 1.27+\">\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue\" alt=\"MIT license\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\nColumns 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.\n\n```go\ntype User struct {\n    ant.Base \u002F\u002F ID, CreatedAt, UpdatedAt\n    Name     string\n    Age      int\n    Posts    []Post \u002F\u002F 1:N through Post.UserID\n}\n\ntype Post struct {\n    ant.Base\n    UserID int64\n    Title  string\n}\n\ntype AppDB struct {\n    ant.Context\n    Users ant.Table[User]\n    Posts ant.Table[Post]\n}\n\nvar Users = ant.Fields[User]()\n\ndb, err := ant.Open[AppDB](ctx, postgres.Dialect, dsn) \u002F\u002F shared, tracks nothing\n\nsession := ant.Session(db) \u002F\u002F one unit of work, such as a request\nadults, err := session.Users.\n    Where(ant.Gt(&Users.Age, 18)). \u002F\u002F ant.Gt(&Users.Age, \"18\") won't compile\n    Include(&Users.Posts).         \u002F\u002F one batched query, not one per user\n    All(ctx)\n\nadults[0].Age++\nerr = session.SaveChanges(ctx) \u002F\u002F writes only the columns that changed\n```\n\n## See it\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F718a63de-dfe2-4749-a923-51e79dd53a2a\n\n## Install\n\n```sh\ngo get github.com\u002Fskudra-go\u002Fant\ngo get github.com\u002Fjackc\u002Fpgx\u002Fv5\u002Fstdlib  # or the driver for your database\n```\n\nRequires Go 1.27 or later, for generic methods.\n\n## Try it in a minute\n\n[examples\u002Fhello](https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant-examples\u002Ftree\u002Fmain\u002Fexamples\u002Fhello) is one file on SQLite. It needs only Go:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant-examples\ncd ant-examples\u002Fexamples\u002Fhello\ngo run .\n```\n\n```text\nCreated Alice\nAlice is 30 and has 2 posts\nHappy birthday, Alice\n```\n\nThe first run takes about 30 seconds, mostly compiling the SQLite driver. The [quick start](https:\u002F\u002Fskudra.net\u002Fquick-start) walks through the same program.\n\n## Next to GORM, Bun and ent\n\nThe same query in each: users over 18 with their posts, sorted by name, 10 at a time. A [test](tools\u002Fcompare) checks that all four return the same rows.\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd>\n\n**ant**: checked, with nothing generated\n\n```go\nusers, err := db.Users.\n\tInclude(&Users.Posts).\n\tWhere(ant.Gt(&Users.Age, 18)).\n\tOrderBy(&Users.Name).\n\tLimit(10).\n\tAll(ctx)\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n**GORM 1.31**: strings, so a typo fails at run time\n\n```go\nvar users []User\n\nerr := db.WithContext(ctx).\n\tPreload(\"Posts\").\n\tWhere(\"age > ?\", 18).\n\tOrder(\"name\").\n\tLimit(10).\n\tFind(&users).\n\tError\n```\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\n\n**Bun 1.3**: strings, so a typo fails at run time\n\n```go\nvar users []User\n\nerr := db.NewSelect().\n\tModel(&users).\n\tRelation(\"Posts\").\n\tWhere(\"age > ?\", 18).\n\tOrder(\"name\").\n\tLimit(10).\n\tScan(ctx)\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n**ent 0.14**: checked, through generated code\n\n```go\nusers, err := client.User.Query().\n\tWithPosts().\n\tWhere(user.AgeGT(18)).\n\tOrder(user.ByName()).\n\tLimit(10).\n\tAll(ctx)\n```\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### What the compiler catches\n\n| Mistake | ant | GORM | Bun | ent | sqlc |\n| --- | :---: | :---: | :---: | :---: | :---: |\n| Misspelled column, `agee` | ✅ | ❌ | ❌ | ✅ | ⚠️ |\n| `\"18\"` for an `int` | ✅ | ❌ | ❌ | ✅ | ✅ |\n| Misspelled relation, `Psots` | ✅ | ❌ | ❌ | ✅ | ⚠️ |\n| Column of another model | ⚠️ | ❌ | ❌ | ✅ | ⚠️ |\n| No code generation step | ✅ | ✅ | ✅ | – | – |\n\n✅ compile error &nbsp; ⚠️ caught by a separate step (`sqlc generate`, or `antvet` for ant) &nbsp; ❌ compiles, fails at run time &nbsp; – needs a generate step\n\nEach cell was tested by compiling the mistake. GORM also has an optional [CLI](https:\u002F\u002Fgithub.com\u002Fgo-gorm\u002Fcli) that generates typed field helpers.\n\n## Performance\n\n[tools\u002Fcompare](tools\u002Fcompare) runs the same operations in each library against PostgreSQL 17 on one machine (Ryzen 5 3600, Docker on WSL2). Each number is the median of 10 runs, and each run repeats the operation hundreds to thousands of times. The database round trip is included, which is why small queries are close. Commits don't wait for the disk, so writes measure the library and not the drive. Plain SQL (a hand-written query and `Scan`, what sqlc generates) is the baseline. Lower is better; 🟢 is the best in each row, shared by any within 1%.\n\n| µs per operation | ant | ant\u003Cbr>\u003Csub>NoTracking\u003C\u002Fsub> | GORM | Bun | ent | | Plain SQL\u003Cbr>\u003Csub>baseline\u003C\u002Fsub> |\n| --- | ---: | ---: | ---: | ---: | ---: | - | ---: |\n| Read 1000 rows | 2,075 | 🟢 **1,692** | 3,361 | 2,370 | 2,240 | | 1,692 |\n| Find one by key | 442 | 397 | 405 | 🟢 **384** | 398 | | 398 |\n| Filter, sort, 10 rows | 557 | 🟢 **539** | 568 | 🟢 **535** | 556 | | 535 |\n| 100 users, 500 posts | 2,238 | 🟢 **1,774** | 2,731 | 2,030 | 2,031 | | 1,581 |\n| Insert one | 410 | – | 420 | 1,112 | 🟢 **404** | | 392 |\n| Update one column | 🟢 **399** | – | 407 | 424 | 🟢 **402** | | 390 |\n| Load, edit, save | 🟢 **805** | – | 818 | 🟢 **812** | 1,869 | | 798 |\n\n| KiB per operation | ant | ant\u003Cbr>\u003Csub>NoTracking\u003C\u002Fsub> | GORM | Bun | ent | | Plain SQL\u003Cbr>\u003Csub>baseline\u003C\u002Fsub> |\n| --- | ---: | ---: | ---: | ---: | ---: | - | ---: |\n| Read 1000 rows | 582 | 🟢 **275** | 392 | 295 | 589 | | 257 |\n| Find one by key | 3.8 | 🟢 **3.5** | 5.7 | 6.3 | 4.9 | | 1.5 |\n| Filter, sort, 10 rows | 11.5 | 🟢 **7.9** | 9.7 | 9.2 | 11.9 | | 3.8 |\n| 100 users, 500 posts | 486 | 🟢 **241** | 362 | 277 | 335 | | 257 |\n| Insert one | 🟢 **2.5** | – | 7.0 | 6.8 | 3.7 | | 1.3 |\n| Update one column | 🟢 **2.5** | – | 5.6 | 5.0 | 3.1 | | 0.3 |\n| Load, edit, save | 🟢 **5.8** | – | 11.2 | 11.2 | 10.7 | | 1.8 |\n\nWhat the numbers say:\n\n- Small queries cost about the same in every library.\n- Change tracking costs on large reads: 1000 rows take 1.2 times as long and twice the memory, because ant keeps a copy of each row to find changes. With `NoTracking`, ant is level with plain SQL here.\n- ant uses the least memory of the four libraries in every row.\n- Bun's insert is slow by default (it prepares every insert as a new statement), and ent's update reads the row back. [tools\u002Fcompare](tools\u002Fcompare#reading-them) has the details.\n\n## Features\n\n- **Typed queries:** conditions, joins, projections, aggregates, subqueries, CTEs and window functions, all checked by the compiler\n- **Plain structs:** your types are the models, with conventions you can override in `Configure`\n- **Relations:** 1:1, 1:N and many-to-many, loaded explicitly with `Include`, in batches. Nothing loads behind your back\n- **Change tracking:** load, edit, `SaveChanges`. Only the columns that changed are written\n- **Writes:** insert, update, delete, upserts, `MERGE` and bulk writes, with a guard against unfiltered updates and deletes\n- **Transactions:** savepoints, isolation levels, retries and read replicas\n- **Lifecycle:** soft deletes, timestamps, global filters, hooks, validation and optimistic concurrency\n- **Migrations:** plain SQL generated from your structs, with drift checks. No down migrations, and no lock-in\n- **Tooling:** a `go vet` analyzer, query logging, metrics, OpenTelemetry, and test fixtures and factories in `anttest`\n\n## Databases\n\n| | PostgreSQL | MySQL | MariaDB | SQLite | SQL Server |\n| --- | :---: | :---: | :---: | :---: | :---: |\n| Queries and writes | ✅ | ✅ | ✅ | ✅ | ✅ |\n| Migrations | ✅ | | | | |\n\nPostgreSQL gets every feature first. [docs\u002Fdatabases.md](docs\u002Fdatabases.md) lists what each database lacks.\n\n## What's missing\n\n- Migrations are PostgreSQL only. On MySQL, MariaDB, SQLite and SQL Server, ant reads and writes, and you manage the schema with your own tool or plain SQL.\n- The full test suite runs on PostgreSQL only. The other databases run a smaller one, so expect more rough edges there.\n- ant is pre-1.0, so the API can still change. Each release lists its breaking changes.\n\nThe [roadmap](docs\u002FROADMAP.md) lists what's planned, and why some items were skipped.\n\n## Learn more\n\n- [Documentation](https:\u002F\u002Fskudra.net): guides, recipes and reference.\n- [Feature examples](tests\u002Ffeatures\u002F): a short test for every feature, edge cases included\n- [ant-examples](https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant-examples): small projects built on ant\n- [Roadmap](docs\u002FROADMAP.md) and [design decisions](docs\u002Fdecisions\u002FREADME.md)\n\n## With an AI assistant\n\nant is newer than most models' training data, so an assistant left to guess writes GORM. Give it the docs:\n\n- **Claude Code**: `\u002Fplugin marketplace add skudra-go\u002Fant`, then `\u002Fplugin install ant@ant`. The [skill](skills\u002Fant\u002FSKILL.md) loads whenever a task touches ant.\n- **Codex, Cursor, Copilot, Gemini CLI and other agents**: `npx skills add skudra-go\u002Fant` installs the same skill.\n- **Any assistant**: point it at [skudra.net\u002Fllms.txt](https:\u002F\u002Fskudra.net\u002Fllms.txt), the docs as Markdown, or [llms-full.txt](https:\u002F\u002Fskudra.net\u002Fllms-full.txt), all of them in one file.\n\nTo have every assistant on a project pick it up, add a line to its `AGENTS.md` or `CLAUDE.md`:\n\n```md\nThis project uses the ant ORM (github.com\u002Fskudra-go\u002Fant), not GORM. Before writing ant code, read https:\u002F\u002Fskudra.net\u002Fllms.txt.\n```\n\n## Contributing\n\nIssues and pull requests are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) first. Report vulnerabilities as [SECURITY.md](SECURITY.md) describes.\n\nThank you to everyone who has filed an issue, fixed a bug or improved the docs:\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fskudra-go\u002Fant\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=skudra-go\u002Fant\" alt=\"Contributors\">\n\u003C\u002Fa>\n\n## About\n\n*Skudra* means *ant* in Latvian, which is where [skudra.net](https:\u002F\u002Fskudra.net) gets its name :)\n\n## License\n\n[MIT](LICENSE)\n","2026-11-24 04:55:13","CREATED_QUERY"]