What is this?
GORM is a full-featured ORM library for Go that aims to be developer friendly, covering associations, hooks, transactions, migrations, and more.
Is it a framework or a library?
It's a library you import into a Go program, not a standalone application or server.
How do I add it to a project?
Import GORM as a Go module into your project and follow the official Getting Started guides for setup and connecting to your database.
Do I need a specific database driver to use it?
Yes, GORM works through database-specific drivers/dialects for whichever SQL database you connect to, though the README does not list specific driver packages.
Does it support features like database routing out of the box?
Core features come built-in, but things like multiple database read/write splitting are provided via an extendable plugin API rather than the core package.
What relationship types does it support?
It supports Has One, Has Many, Belongs To, Many To Many, Polymorphism, and Single-table inheritance associations.
Does it support transactions?
Yes, including Transactions, Nested Transactions, Save Points, and RollbackTo a saved point.
Can it run database migrations?
Yes, GORM includes Auto Migrations as one of its built-in features.
Can it monitor query performance?
Yes, through its plugin API GORM offers a Prometheus plugin for monitoring, among other extensions like the Database Resolver.
What are similar projects?
gin-vue-admin, ent, pgx, mysql, gf, drizzle-orm, ai-novel-studio, migrate