39,989
stars
+2
4,300
forks
486
watchers
1,586
prs
6,153
issues
12
releases
115
discussions
README
GORM The fantastic ORM library for Golang, aims to be developer friendly. Overview Full-Featured ORM Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism, Single-table inheritance) Hooks (Before/After Create/Save/Update/Delete/Find) Eager loading with Preload, Joins Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point Context, Prepared Statement Mode, DryRun Mode Batch Insert, FindInBatches, Find To Map SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr Composite Primary Key Auto Migrations Logger Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus… Every feature comes with tests Developer Friendly Getting Started GORM Guides https://gorm.io Gen Guides https://gorm.io/gen/index.html Contributing You can help to deliver a better GORM, check out things you can do Contributors Thank you for contributing to the GORM framework! License © Jinzhu, 2013~time.Now Released under the MIT License
Top issues
#4944泛型支持15 comments · 2021-12-21#3585sqlite3 'row value misused' error when preloading a model with composite primary keys and foreign key relations14 comments · 2020-10-08#6283Where clauses show up as nil in Scopes13 comments · 2023-04-29#6119v1.24.6 Duplicate saving of sub-table data. v1.24.6 重复保存子表数据13 comments · 2023-03-06#6623How to make batch update using FROM (VALUES) ?12 comments · 2023-10-04#6835Broken SQL generation after v.1.25.6/7 (nested Where?)11 comments · 2024-02-12#4981Single Table Inheritance9 comments · 2022-01-05#6748Bulk Update/Remove associations8 comments · 2023-12-14
Discussions
#7814Static query N+1 detection for Gorm0 comments · 2026-06-21#7757Architecture for a fast, low-noise N+1 Query Linter0 comments · 2026-04-21#7755[Showcase] GoTool: A zero-config online tool to convert SQL into GORM structs0 comments · 2026-04-20#7750Have `TranslateError` wrap the error instead0 comments · 2026-04-09#7744How to join using Generics API1 comments · 2026-03-28#7733Creating a custom Preload1 comments · 2026-03-15#7710String slice into specific schema0 comments · 2026-02-23#7680Built a linter to catch GORM's unsafe `*gorm.DB` reuse0 comments · 2025-12-24
Latest release
Release v1.31.2 v1.31.2 2026-06-25Changes - Fix potential rows leak on panic by deferring rows.Close() @omer-cengel (7798) - perf: replace fmt.Sprintf with strconv in ExplainSQL numeric formatting @alpardfm (7796) - Document NowFunc timezone behavior @morning-verlu (7799) - correct typo and rename fileType to fieldType in AlterColumn @cragone (7748) - fix: panic when using clause.Returning with CreateInBatches @Truongquangkhang (7768) - fix(migrator): add nil guards to ColumnType methods to prevent panic @lihan3238 (7767) - ci: switch tests Go matrix to stable/oldstable and update setup-go @smf-h (7726) - chore(ci): bump acti