mirror of https://github.com/go-gorm/gorm.git
Update README
This commit is contained in:
parent
c6b1669c6a
commit
204356b320
|
@ -5,6 +5,7 @@ The fantastic ORM library for Golang, aims to be developer friendly.
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
* Chainable API
|
* Chainable API
|
||||||
|
* Embedded Structs
|
||||||
* Relations
|
* Relations
|
||||||
* Callbacks (before/after create/save/update/delete/find)
|
* Callbacks (before/after create/save/update/delete/find)
|
||||||
* Soft Deletes
|
* Soft Deletes
|
||||||
|
@ -59,13 +60,13 @@ type User struct {
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
DeletedAt time.Time
|
DeletedAt time.Time
|
||||||
|
|
||||||
Emails []Email // Embedded structs (has many)
|
Emails []Email // One-To-Many relationship (has many)
|
||||||
BillingAddress Address // Embedded struct (has one)
|
BillingAddress Address // One-To-One relationship (has one)
|
||||||
BillingAddressId sql.NullInt64 // Foreign key of BillingAddress
|
BillingAddressId sql.NullInt64 // Foreign key of BillingAddress
|
||||||
ShippingAddress Address // Embedded struct (has one)
|
ShippingAddress Address // One-To-One relationship (has one)
|
||||||
ShippingAddressId int64 // Foreign key of ShippingAddress
|
ShippingAddressId int64 // Foreign key of ShippingAddress
|
||||||
IgnoreMe int64 `sql:"-"` // Ignore this field
|
IgnoreMe int64 `sql:"-"` // Ignore this field
|
||||||
Languages []Language `gorm:"many2many:user_languages;"` // Many To Many, user_languages is the join table
|
Languages []Language `gorm:"many2many:user_languages;"` // Many-To-Many relationship, 'user_languages' is join table
|
||||||
}
|
}
|
||||||
|
|
||||||
type Email struct {
|
type Email struct {
|
||||||
|
|
Loading…
Reference in New Issue