Documentation ¶
Index ¶
- Variables
- type Gender
- type User
- func (user *User) BatchFetchByIDList(db *golib_tools_sqlx.DB, idList []uint64) (userList UserList, err error)
- func (user *User) BatchFetchByNameList(db *golib_tools_sqlx.DB, nameList []string) (userList UserList, err error)
- func (user *User) BatchFetchByNicknameList(db *golib_tools_sqlx.DB, nicknameList []string) (userList UserList, err error)
- func (user *User) BatchFetchByUsernameList(db *golib_tools_sqlx.DB, usernameList []string) (userList UserList, err error)
- func (user *User) ConditionByStruct() *golib_tools_sqlx_builder.Condition
- func (user *User) Create(db *golib_tools_sqlx.DB) error
- func (user *User) CreateOnDuplicateWithUpdateFields(db *golib_tools_sqlx.DB, updateFields []string) error
- func (user *User) D() *golib_tools_sqlx.Database
- func (user *User) DeleteByID(db *golib_tools_sqlx.DB) error
- func (user *User) DeleteByName(db *golib_tools_sqlx.DB) error
- func (user *User) DeleteByStruct(db *golib_tools_sqlx.DB) (err error)
- func (user *User) FetchByID(db *golib_tools_sqlx.DB) error
- func (user *User) FetchByIDForUpdate(db *golib_tools_sqlx.DB) error
- func (user *User) FetchByName(db *golib_tools_sqlx.DB) error
- func (user *User) FetchByNameForUpdate(db *golib_tools_sqlx.DB) error
- func (user *User) FetchList(db *golib_tools_sqlx.DB, size int32, offset int32, ...) (userList UserList, count int32, err error)
- func (user *User) Fields() *UserFields
- func (user *User) IndexFieldNames() []string
- func (user *User) Indexes() golib_tools_sqlx.Indexes
- func (user *User) List(db *golib_tools_sqlx.DB, condition *golib_tools_sqlx_builder.Condition) (userList UserList, err error)
- func (user *User) ListByStruct(db *golib_tools_sqlx.DB) (userList UserList, err error)
- func (user *User) PrimaryKey() golib_tools_sqlx.FieldNames
- func (user *User) SoftDeleteByID(db *golib_tools_sqlx.DB) error
- func (user *User) SoftDeleteByName(db *golib_tools_sqlx.DB) error
- func (user *User) T() *golib_tools_sqlx_builder.Table
- func (user *User) TableName() string
- func (user *User) UniqueIndexes() golib_tools_sqlx.Indexes
- func (user *User) UpdateByIDWithMap(db *golib_tools_sqlx.DB, fieldValues golib_tools_sqlx_builder.FieldValues) error
- func (user *User) UpdateByIDWithStruct(db *golib_tools_sqlx.DB, zeroFields ...string) error
- func (user *User) UpdateByNameWithMap(db *golib_tools_sqlx.DB, fieldValues golib_tools_sqlx_builder.FieldValues) error
- func (user *User) UpdateByNameWithStruct(db *golib_tools_sqlx.DB, zeroFields ...string) error
- type User2
- type UserFields
- type UserList
- func (userList *UserList) BatchFetchByIDList(db *golib_tools_sqlx.DB, idList []uint64) (err error)
- func (userList *UserList) BatchFetchByNameList(db *golib_tools_sqlx.DB, nameList []string) (err error)
- func (userList *UserList) BatchFetchByNicknameList(db *golib_tools_sqlx.DB, nicknameList []string) (err error)
- func (userList *UserList) BatchFetchByUsernameList(db *golib_tools_sqlx.DB, usernameList []string) (err error)
- func (userList *UserList) FetchList(db *golib_tools_sqlx.DB, size int32, offset int32, ...) (count int32, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DBTest = sqlx.NewDatabase("test")
View Source
var UserField = struct { Name string Username string Nickname string Gender string Birthday string Boolean string CreateTime string UpdateTime string ID string Enabled string }{ Name: "Name", Username: "Username", Nickname: "Nickname", Gender: "Gender", Birthday: "Birthday", Boolean: "Boolean", CreateTime: "CreateTime", UpdateTime: "UpdateTime", ID: "ID", Enabled: "Enabled", }
View Source
var UserTable *golib_tools_sqlx_builder.Table
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { // 姓名 Name string `db:"F_name" json:"name" sql:"varchar(255) NOT NULL DEFAULT ''"` Username string `db:"F_username" json:"username" sql:"varchar(255) NOT NULL DEFAULT ''"` Nickname string `db:"F_nickname" json:"nickname" sql:"varchar(255) NOT NULL DEFAULT ''"` Gender Gender `db:"F_gender" json:"gender" sql:"int NOT NULL DEFAULT '0'"` Birthday timelib.MySQLDatetime `db:"F_birthday" json:"birthday" sql:"datetime NOT NULL DEFAULT CURRENT_TIMESTAMP"` Boolean bool `db:"F_boolean" json:"boolean" sql:"boolean NOT NULL DEFAULT '0'"` presets.OperateTime presets.PrimaryID presets.SoftDelete }
@def primary ID @def index I_nickname Nickname @def index I_username Username @def unique_index I_name Name
func (*User) BatchFetchByIDList ¶
func (*User) BatchFetchByNameList ¶
func (*User) BatchFetchByNicknameList ¶
func (*User) BatchFetchByUsernameList ¶
func (*User) ConditionByStruct ¶
func (user *User) ConditionByStruct() *golib_tools_sqlx_builder.Condition
func (*User) CreateOnDuplicateWithUpdateFields ¶
func (user *User) CreateOnDuplicateWithUpdateFields(db *golib_tools_sqlx.DB, updateFields []string) error
func (*User) D ¶
func (user *User) D() *golib_tools_sqlx.Database
func (*User) DeleteByID ¶
func (user *User) DeleteByID(db *golib_tools_sqlx.DB) error
func (*User) DeleteByName ¶
func (user *User) DeleteByName(db *golib_tools_sqlx.DB) error
func (*User) DeleteByStruct ¶
func (user *User) DeleteByStruct(db *golib_tools_sqlx.DB) (err error)
func (*User) FetchByIDForUpdate ¶
func (user *User) FetchByIDForUpdate(db *golib_tools_sqlx.DB) error
func (*User) FetchByName ¶
func (user *User) FetchByName(db *golib_tools_sqlx.DB) error
func (*User) FetchByNameForUpdate ¶
func (user *User) FetchByNameForUpdate(db *golib_tools_sqlx.DB) error
func (*User) FetchList ¶
func (user *User) FetchList(db *golib_tools_sqlx.DB, size int32, offset int32, conditions ...*golib_tools_sqlx_builder.Condition) (userList UserList, count int32, err error)
func (*User) Fields ¶
func (user *User) Fields() *UserFields
func (*User) IndexFieldNames ¶
func (*User) Indexes ¶
func (user *User) Indexes() golib_tools_sqlx.Indexes
func (*User) List ¶
func (user *User) List(db *golib_tools_sqlx.DB, condition *golib_tools_sqlx_builder.Condition) (userList UserList, err error)
func (*User) ListByStruct ¶
func (user *User) ListByStruct(db *golib_tools_sqlx.DB) (userList UserList, err error)
func (*User) PrimaryKey ¶
func (user *User) PrimaryKey() golib_tools_sqlx.FieldNames
func (*User) SoftDeleteByID ¶
func (user *User) SoftDeleteByID(db *golib_tools_sqlx.DB) error
func (*User) SoftDeleteByName ¶
func (user *User) SoftDeleteByName(db *golib_tools_sqlx.DB) error
func (*User) T ¶
func (user *User) T() *golib_tools_sqlx_builder.Table
func (*User) UniqueIndexes ¶
func (user *User) UniqueIndexes() golib_tools_sqlx.Indexes
func (*User) UpdateByIDWithMap ¶
func (user *User) UpdateByIDWithMap(db *golib_tools_sqlx.DB, fieldValues golib_tools_sqlx_builder.FieldValues) error
func (*User) UpdateByIDWithStruct ¶
func (user *User) UpdateByIDWithStruct(db *golib_tools_sqlx.DB, zeroFields ...string) error
func (*User) UpdateByNameWithMap ¶
func (user *User) UpdateByNameWithMap(db *golib_tools_sqlx.DB, fieldValues golib_tools_sqlx_builder.FieldValues) error
func (*User) UpdateByNameWithStruct ¶
func (user *User) UpdateByNameWithStruct(db *golib_tools_sqlx.DB, zeroFields ...string) error
type User2 ¶
type User2 struct {
Name string `db:"F_name" json:"name" sql:"varchar(255) NOT NULL DEFAULT ''"`
}
type UserFields ¶
type UserFields struct { Name *golib_tools_sqlx_builder.Column Username *golib_tools_sqlx_builder.Column Nickname *golib_tools_sqlx_builder.Column Gender *golib_tools_sqlx_builder.Column Birthday *golib_tools_sqlx_builder.Column Boolean *golib_tools_sqlx_builder.Column CreateTime *golib_tools_sqlx_builder.Column UpdateTime *golib_tools_sqlx_builder.Column ID *golib_tools_sqlx_builder.Column Enabled *golib_tools_sqlx_builder.Column }
type UserList ¶
type UserList []User
func (*UserList) BatchFetchByIDList ¶
func (userList *UserList) BatchFetchByIDList(db *golib_tools_sqlx.DB, idList []uint64) (err error)
deprecated
func (*UserList) BatchFetchByNameList ¶
func (userList *UserList) BatchFetchByNameList(db *golib_tools_sqlx.DB, nameList []string) (err error)
deprecated
func (*UserList) BatchFetchByNicknameList ¶
func (userList *UserList) BatchFetchByNicknameList(db *golib_tools_sqlx.DB, nicknameList []string) (err error)
deprecated
func (*UserList) BatchFetchByUsernameList ¶
func (userList *UserList) BatchFetchByUsernameList(db *golib_tools_sqlx.DB, usernameList []string) (err error)
deprecated
Click to show internal directories.
Click to hide internal directories.