# 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
# Functions
Expr returns clause.Expr, which can be used to pass SQL expression as params.
No description provided by the author
Open initialize db session based on dialector.
Scan scan rows into db statement.
# Variables
ErrCheckConstraintViolated occurs when there is a check constraint violation.
ErrDryRunModeUnsupported dry run mode unsupported.
ErrDuplicatedKey occurs when there is a unique key constraint violation.
ErrEmptySlice empty slice found.
ErrForeignKeyViolated occurs when there is a foreign key constraint violation.
ErrInvalidData unsupported data.
ErrInvalidDB invalid db.
ErrInvalidField invalid field.
ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback`.
ErrInvalidValue invalid value.
ErrInvalidValueOfLength invalid values do not match length.
ErrMissingWhereClause missing where clause.
ErrModelAccessibleFieldsRequired model accessible fields required.
ErrModelValueRequired model value required.
ErrNotImplemented not implemented.
ErrPreloadNotAllowed preload is not allowed when count is used.
ErrPrimaryKeyRequired primary keys required.
ErrRecordNotFound record not found error.
ErrRegistered registered.
ErrSubQueryRequired sub query required.
ErrUnsupportedDriver unsupported driver.
ErrUnsupportedRelation unsupported relations.
# Structs
Association Mode contains some helper methods to handle relationship things easily.
Config GORM config.
DB GORM DB definition.
Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt It may be embedded into your model or you may build your own model without it
type User struct { gorm.Model }.
No description provided by the author
No description provided by the author
Session session config when create session with Session() method.
No description provided by the author
No description provided by the author
No description provided by the author
Statement statement.
No description provided by the author
ViewOption view option.
# Interfaces
ColumnType column type interface.
ConnPool db conns pool interface.
ConnPoolBeginner conn pool beginner.
Dialector GORM database dialector.
No description provided by the author
GetDBConnector SQL db connector.
No description provided by the author
Migrator migrator interface.
Option gorm option interface.
No description provided by the author
Plugin GORM plugin interface.
Rows rows interface.
SavePointerDialectorInterface save pointer interface.
StatementModifier statement modifier interface.
TableType table type interface.
Tx sql.Tx interface.
TxBeginner tx beginner.
TxCommitter tx committer.
Valuer gorm valuer interface.