Documentation
¶
Index ¶
- Variables
- func AccountMgr(db *gorm.DB) *_AccountMgr
- func CloseRelated()
- func OpenRelated()
- func UserMgr(db *gorm.DB) *_UserMgr
- type Account
- type Condition
- func (c *Condition) And(column string, cases string, value interface{}) *Condition
- func (c *Condition) AndWithCondition(condition bool, column string, cases string, value interface{}) *Condition
- func (c *Condition) Get() (where string, out []interface{})
- func (c *Condition) Or(column string, cases string, value interface{}) *Condition
- func (c *Condition) OrWithCondition(condition bool, column string, cases string, value interface{}) *Condition
- type Option
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AccountColumns = struct { ID string AccountID string UserID string Type string Name string }{ ID: "id", AccountID: "account_id", UserID: "user_id", Type: "type", Name: "name", }
AccountColumns get sql column name.获取数据库列名
View Source
var UserColumns = struct { UserID string Name string Sex string Job string }{ UserID: "user_id", Name: "name", Sex: "sex", Job: "job", }
UserColumns get sql column name.获取数据库列名
Functions ¶
Types ¶
type Account ¶
type Account struct { ID int `gorm:"primaryKey;column:id;type:int(11);not null" json:"-"` AccountID int `gorm:"uniqueIndex:account;column:account_id;type:int(11)" json:"accountId"` UserID int `gorm:"uniqueIndex:account;index:tp;column:user_id;type:int(11)" json:"userId"` User User `gorm:"joinForeignKey:user_id;foreignKey:user_id" json:"userList"` Type int `gorm:"index:tp;column:type;type:int(11)" json:"type"` Name string `gorm:"column:name;type:varchar(255)" json:"name"` }
Account [...]
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
自定义sql查询
func (*Condition) AndWithCondition ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option overrides behavior of Connect.
type User ¶
type User struct { UserID int `gorm:"primaryKey;column:user_id;type:int(11);not null" json:"-"` Name string `gorm:"column:name;type:varchar(30);not null" json:"name"` Sex int `gorm:"column:sex;type:int(11);not null" json:"sex"` Job int `gorm:"column:job;type:int(11);not null" json:"job"` }
User [...]
Click to show internal directories.
Click to hide internal directories.