Command Palette

Search for a command to run...

position in category
#11

Entity framework for Go that models database schema as a graph and uses code generation to produce a fully typed, explicit API. Schemas are defined as programmatic Go code, then compiled into predicates, validators, and CRUD operations, making it easy to build and maintain applications with large data models.

Originated at Meta and widely adopted in the Go ecosystem. Compared to struct-based ORMs like GORM or sqlc, ent treats the schema as the source of truth and generates idiomatic Go code from it, which yields stronger compile-time guarantees and simpler graph traversals across relations.

Core capabilities:

  • Schema-as-code with programmatic Go definitions for entities, fields, edges, and validators
  • Graph traversals: query across relations with fluent chains like QueryGroups().QueryUsers().QueryCars()
  • Code generation for static typing, predicates, and storage-aware APIs
  • Support for SQLite, PostgreSQL, and MySQL with automatic or versioned migrations via Atlas
  • Extensible via Go templates for custom generation and schema hooks

Fits Go services with complex domain models and relational graphs where type safety and graph traversal matter more than quick struct mapping. Suits backends that need schema evolution tracked in version control, clear migration paths, and IDE autocomplete for all queries. Integrates with Atlas for production-grade migrations and works alongside standard Go tooling.

GitHub Repositories
15
-16.7%
Trending down this week
Removed in 3 repos