特性 安装 快速入门 The fantastic ORM library for Golang aims to be developer friendly. 特性 全功能 ORM 关联 (Has One,Has Many,Belongs To,Many To Many,多态,单表继承) Create,Save,Update,Delete,Fin...
约定 使用 ID 作为主键 复数表名 TableName 临时指定表名 命名策略 列名 时间戳追踪 CreatedAt UpdatedAt 约定 使用 ID 作为主键 默认情况下,GORM 会使用 ID 作为表的主键。 type User struct { ID string // 默认情况下,名...
Logger Log Levels Debug Customize Logger Logger Gorm has a default logger implementation , it will print Slow SQL and happening errors by default The logger accepts few opti...
Has Many Declare Retrieve Override Foreign Key Override References Polymorphism Association CRUD with Has Many Eager Loading Self-Referential Has Many FOREIGN KEY Constrai...