GORM is a developer-focused object-relational mapping library for Go that provides a comprehensive data persistence framework. It serves as a database access layer, allowing developers to map application structures to database tables and perform CRUD operations using a fluent, type-safe query builder instead of writing raw SQL.
The library distinguishes itself through its association-aware persistence, which automatically tracks and synchronizes complex entity relationships during database operations. It utilizes a driver-agnostic interface to maintain consistent behavior across various storage engines and employs a reflection-based system to map programming language types to database schemas. Developers can further customize behavior using a callback-based hook system that executes logic at specific points in the operation lifecycle.
Beyond core mapping, the project provides robust support for transaction management, connection pooling, and automated schema migrations. It handles complex relational modeling, including one-to-one, one-to-many, and many-to-many associations, while offering advanced features like eager loading, soft deletes, and conflict resolution strategies for upsert operations.
The framework is designed for integration into Go applications, providing a unified interface for managing database connectivity and transactional integrity.