database

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBTest = sqlx.NewDatabase("test")

Functions

This section is empty.

Types

type Gender

type Gender int
const (
	GenderMale Gender = iota + 1
	GenderFemale
)

func (Gender) String

func (g Gender) String() string

type GeomString added in v1.1.0

type GeomString struct {
	V string
}

func (GeomString) DataType added in v1.1.1

func (GeomString) DataType() string

func (*GeomString) Scan added in v1.1.1

func (g *GeomString) Scan(src interface{}) error

func (GeomString) Value added in v1.1.1

func (g GeomString) Value() (driver.Value, error)

func (GeomString) ValueEx added in v1.1.0

func (GeomString) ValueEx() string

type User

type User struct {
	ID uint64 `db:"F_id" json:"-" sql:"bigint unsigned NOT NULL DEFAULT '0'"`
	// 姓名
	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  datatypes.MySQLDatetime  `db:"F_birthday" json:"birthday" sql:"datetime NOT NULL"`
	Boolean   bool                     `db:"F_boolean" json:"boolean" sql:"tinyint(1) NOT NULL DEFAULT '0'"`
	Geom      GeomString               `db:"F_geom" json:"geom" sql:"geometry NOT NULL"`
	CreatedAt datatypes.MySQLTimestamp `db:"F_created_at" json:"createdAt" sql:"bigint NOT NULL DEFAULT '0'"`
	UpdatedAt datatypes.MySQLTimestamp `db:"F_updated_at" json:"updatedAt" sql:"bigint NOT NULL DEFAULT '0'"`
	Enabled   datatypes.Bool           `db:"F_enabled" json:"enabled" sql:"int NOT NULL DEFAULT '0'"`
}

@def primary ID @def index I_nickname Nickname @def index I_username Username @def unique_index I_name Name @def spatial_index I_geom Geom

func (*User) BatchFetchByGeomList added in v1.1.0

func (m *User) BatchFetchByGeomList(db *github_com_go_courier_sqlx.DB, values []GeomString) ([]User, error)

func (*User) BatchFetchByIDList

func (m *User) BatchFetchByIDList(db *github_com_go_courier_sqlx.DB, values []uint64) ([]User, error)

func (*User) BatchFetchByNameList

func (m *User) BatchFetchByNameList(db *github_com_go_courier_sqlx.DB, values []string) ([]User, error)

func (*User) BatchFetchByNicknameList

func (m *User) BatchFetchByNicknameList(db *github_com_go_courier_sqlx.DB, values []string) ([]User, error)

func (*User) BatchFetchByUsernameList

func (m *User) BatchFetchByUsernameList(db *github_com_go_courier_sqlx.DB, values []string) ([]User, error)

func (User) Comments

func (User) Comments() map[string]string

func (*User) ConditionByStruct

func (m *User) ConditionByStruct() *github_com_go_courier_sqlx_builder.Condition

func (*User) Create

func (m *User) Create(db *github_com_go_courier_sqlx.DB) error

func (*User) CreateOnDuplicateWithUpdateFields

func (m *User) CreateOnDuplicateWithUpdateFields(db *github_com_go_courier_sqlx.DB, updateFields []string) error

func (User) D

func (*User) DeleteByID

func (m *User) DeleteByID(db *github_com_go_courier_sqlx.DB) error

func (*User) DeleteByName

func (m *User) DeleteByName(db *github_com_go_courier_sqlx.DB) error

func (*User) DeleteByStruct

func (m *User) DeleteByStruct(db *github_com_go_courier_sqlx.DB) error

func (*User) FetchByID

func (m *User) FetchByID(db *github_com_go_courier_sqlx.DB) error

func (*User) FetchByIDForUpdate

func (m *User) FetchByIDForUpdate(db *github_com_go_courier_sqlx.DB) error

func (*User) FetchByName

func (m *User) FetchByName(db *github_com_go_courier_sqlx.DB) error

func (*User) FetchByNameForUpdate

func (m *User) FetchByNameForUpdate(db *github_com_go_courier_sqlx.DB) error

func (*User) FieldBirthday

func (m *User) FieldBirthday() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldBoolean

func (m *User) FieldBoolean() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldCreatedAt

func (m *User) FieldCreatedAt() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldEnabled

func (m *User) FieldEnabled() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldGender

func (*User) FieldGeom added in v1.1.0

func (*User) FieldID

func (User) FieldKeyBirthday

func (User) FieldKeyBirthday() string

func (User) FieldKeyBoolean

func (User) FieldKeyBoolean() string

func (User) FieldKeyCreatedAt

func (User) FieldKeyCreatedAt() string

func (User) FieldKeyEnabled

func (User) FieldKeyEnabled() string

func (User) FieldKeyGender

func (User) FieldKeyGender() string

func (User) FieldKeyGeom added in v1.1.0

func (User) FieldKeyGeom() string

func (User) FieldKeyID

func (User) FieldKeyID() string

func (User) FieldKeyName

func (User) FieldKeyName() string

func (User) FieldKeyNickname

func (User) FieldKeyNickname() string

func (User) FieldKeyUpdatedAt

func (User) FieldKeyUpdatedAt() string

func (User) FieldKeyUsername

func (User) FieldKeyUsername() string

func (*User) FieldName

func (*User) FieldNickname

func (m *User) FieldNickname() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldUpdatedAt

func (m *User) FieldUpdatedAt() *github_com_go_courier_sqlx_builder.Column

func (*User) FieldUsername

func (m *User) FieldUsername() *github_com_go_courier_sqlx_builder.Column

func (*User) IndexFieldNames

func (m *User) IndexFieldNames() []string

func (*User) SoftDeleteByID

func (m *User) SoftDeleteByID(db *github_com_go_courier_sqlx.DB) error

func (*User) SoftDeleteByName

func (m *User) SoftDeleteByName(db *github_com_go_courier_sqlx.DB) error

func (User) SpatialIndexes added in v1.1.0

func (User) TableName

func (User) TableName() string

func (User) UniqueIndexes

func (*User) UpdateByIDWithMap

func (*User) UpdateByIDWithStruct

func (m *User) UpdateByIDWithStruct(db *github_com_go_courier_sqlx.DB, zeroFields ...string) error

func (*User) UpdateByNameWithMap

func (m *User) UpdateByNameWithMap(db *github_com_go_courier_sqlx.DB, fieldValues github_com_go_courier_sqlx_builder.FieldValues) error

func (*User) UpdateByNameWithStruct

func (m *User) UpdateByNameWithStruct(db *github_com_go_courier_sqlx.DB, zeroFields ...string) error

type User2

type User2 struct {
	Name string `db:"F_name" json:"name" sql:"varchar(255) NOT NULL DEFAULT ''"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL