2.7 KiB
2.7 KiB
GORM
为 Golang 设计的出色 ORM 库,旨在使开发人员更加友好地开发
概述
- 对象关联(Has One、Has Many、Belongs To、Many To Many、Polymorphism、Single-table inheritance)
- 钩子函数(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 构建器(SQL Builder)、更新/插入(Upsert)、锁定(Locking)、优化器/索引/注释提示(Optimizer/Index/Comment Hints)、命名参数(NamedArg)、带有 SQL 表达式的搜索/更新/创建(Search/Update/Create with SQL Expr)
- 复合主键(Composite Primary Key)
- 自动迁移(Auto Migrations)
- 日志记录器(Logger)
- 可扩展、灵活的插件 API:数据库解析器(Database Resolver,支持多数据库、读写分离)/ Prometheus…
- 每个特性都附带测试
- 开发者友好(Developer Friendly)
入门
- GORM 指南 https://gorm.io
- 生成指南 https://gorm.io/gen/index.html
贡献
贡献者
感谢您对 GORM 框架的贡献!
执照
© Jinzhu, 2013~time.Now