Documentation ¶
Index ¶
- Variables
- type Gender
- type GeomString
- type Org
- func (*Org) ColDesc() map[string][]string
- func (m *Org) ColID() *builder.Column
- func (m *Org) ColName() *builder.Column
- func (*Org) ColRel() map[string][]string
- func (m *Org) ColUserID() *builder.Column
- func (*Org) Comments() map[string]string
- func (m *Org) CondByValue(db sqlx.DBExecutor) builder.SqlCondition
- func (m *Org) Count(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) (cnt int64, err error)
- func (m *Org) Create(db sqlx.DBExecutor) error
- func (m *Org) Delete(db sqlx.DBExecutor) error
- func (m *Org) DeleteByID(db sqlx.DBExecutor) error
- func (m *Org) FetchByID(db sqlx.DBExecutor) error
- func (*Org) FieldID() string
- func (*Org) FieldName() string
- func (*Org) FieldUserID() string
- func (m *Org) IndexFieldNames() []string
- func (m *Org) List(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) ([]Org, error)
- func (*Org) PrimaryKey() []string
- func (*Org) TableDesc() []string
- func (*Org) TableName() string
- func (m *Org) UpdateByID(db sqlx.DBExecutor, zeros ...string) error
- func (m *Org) UpdateByIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
- type OrgIterator
- type User
- func (m *User) ColBoolean() *builder.Column
- func (m *User) ColCreatedAt() *builder.Column
- func (m *User) ColDeletedAt() *builder.Column
- func (*User) ColDesc() map[string][]string
- func (m *User) ColGender() *builder.Column
- func (m *User) ColGeom() *builder.Column
- func (m *User) ColID() *builder.Column
- func (m *User) ColName() *builder.Column
- func (m *User) ColNickname() *builder.Column
- func (m *User) ColOrgID() *builder.Column
- func (*User) ColRel() map[string][]string
- func (m *User) ColUpdatedAt() *builder.Column
- func (m *User) ColUsername() *builder.Column
- func (*User) Comments() map[string]string
- func (m *User) CondByValue(db sqlx.DBExecutor) builder.SqlCondition
- func (m *User) Count(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) (cnt int64, err error)
- func (m *User) Create(db sqlx.DBExecutor) error
- func (m *User) Delete(db sqlx.DBExecutor) error
- func (m *User) DeleteByID(db sqlx.DBExecutor) error
- func (m *User) DeleteByIDAndOrgID(db sqlx.DBExecutor) error
- func (m *User) DeleteByName(db sqlx.DBExecutor) error
- func (m *User) FetchByID(db sqlx.DBExecutor) error
- func (m *User) FetchByIDAndOrgID(db sqlx.DBExecutor) error
- func (m *User) FetchByName(db sqlx.DBExecutor) error
- func (*User) FieldBoolean() string
- func (*User) FieldCreatedAt() string
- func (*User) FieldDeletedAt() string
- func (*User) FieldGender() string
- func (*User) FieldGeom() string
- func (*User) FieldID() string
- func (*User) FieldName() string
- func (*User) FieldNickname() string
- func (*User) FieldOrgID() string
- func (*User) FieldUpdatedAt() string
- func (*User) FieldUsername() string
- func (m *User) IndexFieldNames() []string
- func (*User) Indexes() builder.Indexes
- func (m *User) List(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) ([]User, error)
- func (*User) PrimaryKey() []string
- func (m *User) SoftDeleteByID(db sqlx.DBExecutor) error
- func (m *User) SoftDeleteByIDAndOrgID(db sqlx.DBExecutor) error
- func (m *User) SoftDeleteByName(db sqlx.DBExecutor) error
- func (*User) TableDesc() []string
- func (*User) TableName() string
- func (*User) UniqueIndexUIIDOrg() string
- func (*User) UniqueIndexUIName() string
- func (*User) UniqueIndexes() builder.Indexes
- func (m *User) UpdateByID(db sqlx.DBExecutor, zeros ...string) error
- func (m *User) UpdateByIDAndOrgID(db sqlx.DBExecutor, zeros ...string) error
- func (m *User) UpdateByIDAndOrgIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
- func (m *User) UpdateByIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
- func (m *User) UpdateByName(db sqlx.DBExecutor, zeros ...string) error
- func (m *User) UpdateByNameWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
- type UserIterator
Constants ¶
This section is empty.
Variables ¶
View Source
var DB = sqlx.NewDatabase("test")
View Source
var OrgTable *builder.Table
View Source
var UserTable *builder.Table
Functions ¶
This section is empty.
Types ¶
type GeomString ¶
type GeomString struct {
V string
}
func (GeomString) DataType ¶
func (GeomString) DataType(driverName string) string
func (*GeomString) Scan ¶
func (g *GeomString) Scan(src interface{}) error
func (GeomString) ValueEx ¶
func (GeomString) ValueEx() string
type Org ¶
type Org struct { ID uint64 `db:"f_id,autoincrement"` Name string `db:"f_name,default=''"` // @rel User.ID // User relation... UserID string `db:"f_user_id"` }
Org describe organization information
func (*Org) CondByValue ¶
func (m *Org) CondByValue(db sqlx.DBExecutor) builder.SqlCondition
func (*Org) Count ¶
func (m *Org) Count(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) (cnt int64, err error)
func (*Org) DeleteByID ¶
func (m *Org) DeleteByID(db sqlx.DBExecutor) error
func (*Org) FieldUserID ¶
func (*Org) IndexFieldNames ¶
func (*Org) List ¶
func (m *Org) List(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) ([]Org, error)
func (*Org) PrimaryKey ¶
func (*Org) UpdateByID ¶
func (m *Org) UpdateByID(db sqlx.DBExecutor, zeros ...string) error
func (*Org) UpdateByIDWithFVs ¶
func (m *Org) UpdateByIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
type OrgIterator ¶
type OrgIterator struct { }
func (*OrgIterator) New ¶
func (*OrgIterator) New() interface{}
func (*OrgIterator) Resolve ¶
func (*OrgIterator) Resolve(v interface{}) *Org
type User ¶
type User struct { ID uint64 `db:"f_id,autoincrement"` Name string `db:"f_name,default=''"` // 姓名 Nickname string `db:"f_nickname,default=''"` // 昵称 Username string `db:"f_username,default=''"` // 用户名 Gender Gender `db:"f_gender,default='0'"` Boolean bool `db:"f_boolean,default=false"` Geom GeomString `db:"f_geom"` // @rel Org.ID // 关联组织 // 组织ID OrgID uint64 `db:"f_org_id"` CreatedAt types.Timestamp `db:"f_created_at,default='0'"` UpdatedAt types.Timestamp `db:"f_updated_at,default='0'"` DeletedAt types.Timestamp `db:"f_deleted_at,default='0'"` }
User 用户表
func (*User) ColBoolean ¶
func (*User) ColCreatedAt ¶
func (*User) ColDeletedAt ¶
func (*User) ColNickname ¶
func (*User) ColUpdatedAt ¶
func (*User) ColUsername ¶
func (*User) CondByValue ¶
func (m *User) CondByValue(db sqlx.DBExecutor) builder.SqlCondition
func (*User) Count ¶
func (m *User) Count(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) (cnt int64, err error)
func (*User) DeleteByID ¶
func (m *User) DeleteByID(db sqlx.DBExecutor) error
func (*User) DeleteByIDAndOrgID ¶
func (m *User) DeleteByIDAndOrgID(db sqlx.DBExecutor) error
func (*User) DeleteByName ¶
func (m *User) DeleteByName(db sqlx.DBExecutor) error
func (*User) FetchByIDAndOrgID ¶
func (m *User) FetchByIDAndOrgID(db sqlx.DBExecutor) error
func (*User) FetchByName ¶
func (m *User) FetchByName(db sqlx.DBExecutor) error
func (*User) FieldBoolean ¶
func (*User) FieldCreatedAt ¶
func (*User) FieldDeletedAt ¶
func (*User) FieldGender ¶
func (*User) FieldNickname ¶
func (*User) FieldOrgID ¶
func (*User) FieldUpdatedAt ¶
func (*User) FieldUsername ¶
func (*User) IndexFieldNames ¶
func (*User) List ¶
func (m *User) List(db sqlx.DBExecutor, cond builder.SqlCondition, adds ...builder.Addition) ([]User, error)
func (*User) PrimaryKey ¶
func (*User) SoftDeleteByID ¶
func (m *User) SoftDeleteByID(db sqlx.DBExecutor) error
func (*User) SoftDeleteByIDAndOrgID ¶
func (m *User) SoftDeleteByIDAndOrgID(db sqlx.DBExecutor) error
func (*User) SoftDeleteByName ¶
func (m *User) SoftDeleteByName(db sqlx.DBExecutor) error
func (*User) UniqueIndexUIIDOrg ¶
func (*User) UniqueIndexUIName ¶
func (*User) UniqueIndexes ¶
func (*User) UpdateByID ¶
func (m *User) UpdateByID(db sqlx.DBExecutor, zeros ...string) error
func (*User) UpdateByIDAndOrgID ¶
func (m *User) UpdateByIDAndOrgID(db sqlx.DBExecutor, zeros ...string) error
func (*User) UpdateByIDAndOrgIDWithFVs ¶
func (m *User) UpdateByIDAndOrgIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
func (*User) UpdateByIDWithFVs ¶
func (m *User) UpdateByIDWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
func (*User) UpdateByName ¶
func (m *User) UpdateByName(db sqlx.DBExecutor, zeros ...string) error
func (*User) UpdateByNameWithFVs ¶
func (m *User) UpdateByNameWithFVs(db sqlx.DBExecutor, fvs builder.FieldValues) error
type UserIterator ¶
type UserIterator struct { }
func (*UserIterator) New ¶
func (*UserIterator) New() interface{}
func (*UserIterator) Resolve ¶
func (*UserIterator) Resolve(v interface{}) *User
Click to show internal directories.
Click to hide internal directories.