tests

package
v0.0.0-...-8fc1c82 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateTableMySql = "" /* 226-byte string literal not displayed */
	DropTableMySql   = "DROP TABLE IF EXISTS `big_struct`;"
)

Variables

View Source
var ShowTestSql bool = true

Functions

func BaseTestAll

func BaseTestAll(engine *xorm.Engine, t *testing.T)

func BaseTestAll2

func BaseTestAll2(engine *xorm.Engine, t *testing.T)

func BaseTestAll3

func BaseTestAll3(engine *xorm.Engine, t *testing.T)

!nash! the 3rd set of the test is intended for non-cache enabled engine

func BaseTestAllSameMapper

func BaseTestAllSameMapper(engine *xorm.Engine, t *testing.T)

func BaseTestAllSnakeMapper

func BaseTestAllSnakeMapper(engine *xorm.Engine, t *testing.T)

func DoBenchDriver

func DoBenchDriver(newdriver func() (*sql.DB, error), createTableSql,
	dropTableSql string, opFunc func(*sql.DB, *testing.B), t *testing.B)

func DoBenchDriverFind

func DoBenchDriverFind(db *sql.DB, b *testing.B)

func DoBenchDriverInsert

func DoBenchDriverInsert(db *sql.DB, b *testing.B)

func DoBenchFind

func DoBenchFind(engine *xorm.Engine, b *testing.B)

func DoBenchFindPtr

func DoBenchFindPtr(engine *xorm.Engine, b *testing.B)

func DoBenchInsert

func DoBenchInsert(engine *xorm.Engine, b *testing.B)

func NewCacher

func NewCacher() core.Cacher

Types

type Article

type Article struct {
	Id      int32  `xorm:"pk INT autoincr"`
	Name    string `xorm:"VARCHAR(45)"`
	Img     string `xorm:"VARCHAR(100)"`
	Aside   string `xorm:"VARCHAR(200)"`
	Desc    string `xorm:"VARCHAR(200)"`
	Content string `xorm:"TEXT"`
	Status  int8   `xorm:"TINYINT(4)"`
}

type BigInsert

type BigInsert struct {
}

type BigStruct

type BigStruct struct {
	Id       int64
	Name     string
	Title    string
	Age      string
	Alias    string
	NickName string
}

type CompositeKey

type CompositeKey struct {
	Id1       int64 `xorm:"id1 pk"`
	Id2       int64 `xorm:"id2 pk"`
	UpdateStr string
}

type Condi

type Condi map[string]interface{}

type CreatedUpdated

type CreatedUpdated struct {
	Id       int64
	Name     string
	Value    float64   `xorm:"numeric"`
	Created  time.Time `xorm:"created"`
	Created2 time.Time `xorm:"created"`
	Updated  time.Time `xorm:"updated"`
}

type CustomTableName

type CustomTableName struct {
	Id   int64
	Name string
}

func (*CustomTableName) TableName

func (c *CustomTableName) TableName() string

type IndexOrUnique

type IndexOrUnique struct {
	Id        int64
	Index     int `xorm:"index"`
	Unique    int `xorm:"unique"`
	Group1    int `xorm:"index(ttt)"`
	Group2    int `xorm:"index(ttt)"`
	UniGroup1 int `xorm:"unique(lll)"`
	UniGroup2 int `xorm:"unique(lll)"`
}

type Int32Id

type Int32Id struct {
	Id   int32 `xorm:"pk autoincr"`
	Name string
}

type IntId

type IntId struct {
	Id   int `xorm:"pk autoincr"`
	Name string
}

type Lowercase

type Lowercase struct {
	Id   int64
	Name string
	// contains filtered or unexported fields
}

type MyFloat

type MyFloat float64

type MyInt

type MyInt int

type MyString

type MyString string

type MyStruct

type MyStruct struct {
	Type      MyInt
	U         MyUInt
	F         MyFloat
	S         MyString
	IA        []MyInt
	UA        []MyUInt
	FA        []MyFloat
	SA        []MyString
	NameArray []string
	Name      string
	UIA       []uint
	UIA8      []uint8
	UIA16     []uint16
	UIA32     []uint32
	UIA64     []uint64
	UI        uint
	//C64       complex64
	MSS map[string]string
}

type MyUInt

type MyUInt uint

type NoIdUser

type NoIdUser struct {
	User   string `xorm:"unique"`
	Remain int64
	Total  int64
}

type NullData

type NullData struct {
	Id         int64
	StringPtr  *string
	StringPtr2 *string `xorm:"text"`
	BoolPtr    *bool
	BytePtr    *byte
	UintPtr    *uint
	Uint8Ptr   *uint8
	Uint16Ptr  *uint16
	Uint32Ptr  *uint32
	Uint64Ptr  *uint64
	IntPtr     *int
	Int8Ptr    *int8
	Int16Ptr   *int16
	Int32Ptr   *int32
	Int64Ptr   *int64
	RunePtr    *rune
	Float32Ptr *float32
	Float64Ptr *float64
	// Complex64Ptr *complex64 // !nashtsai! XORM yet support complex128:  'json: unsupported type: complex128'
	// Complex128Ptr *complex128 // !nashtsai! XORM yet support complex128:  'json: unsupported type: complex128'
	TimePtr *time.Time
}

type NullData2

type NullData2 struct {
	Id         int64
	StringPtr  string
	StringPtr2 string `xorm:"text"`
	BoolPtr    bool
	BytePtr    byte
	UintPtr    uint
	Uint8Ptr   uint8
	Uint16Ptr  uint16
	Uint32Ptr  uint32
	Uint64Ptr  uint64
	IntPtr     int
	Int8Ptr    int8
	Int16Ptr   int16
	Int32Ptr   int32
	Int64Ptr   int64
	RunePtr    rune
	Float32Ptr float32
	Float64Ptr float64
	// Complex64Ptr complex64 // !nashtsai! XORM yet support complex128:  'json: unsupported type: complex128'
	// Complex128Ptr complex128 // !nashtsai! XORM yet support complex128:  'json: unsupported type: complex128'
	TimePtr time.Time
}

type NullData3

type NullData3 struct {
	Id        int64
	StringPtr *string
}

type Picture

type Picture struct {
	Id          int64
	Url         string `xorm:"unique"` //image's url
	Title       string
	Description string
	Created     time.Time `xorm:"created"`
	ILike       int
	PageView    int
	From_url    string
	Pre_url     string `xorm:"unique"` //pre view image's url
	Uid         int64
}

type ProcessorsStruct

type ProcessorsStruct struct {
	Id int64

	B4InsertFlag      int
	AfterInsertedFlag int
	B4UpdateFlag      int
	AfterUpdatedFlag  int
	B4DeleteFlag      int `xorm:"-"`
	AfterDeletedFlag  int `xorm:"-"`

	B4InsertViaExt      int
	AfterInsertedViaExt int
	B4UpdateViaExt      int
	AfterUpdatedViaExt  int
	B4DeleteViaExt      int `xorm:"-"`
	AfterDeletedViaExt  int `xorm:"-"`
}

func (*ProcessorsStruct) AfterDelete

func (p *ProcessorsStruct) AfterDelete()

func (*ProcessorsStruct) AfterInsert

func (p *ProcessorsStruct) AfterInsert()

func (*ProcessorsStruct) AfterUpdate

func (p *ProcessorsStruct) AfterUpdate()

func (*ProcessorsStruct) BeforeDelete

func (p *ProcessorsStruct) BeforeDelete()

func (*ProcessorsStruct) BeforeInsert

func (p *ProcessorsStruct) BeforeInsert()

func (*ProcessorsStruct) BeforeUpdate

func (p *ProcessorsStruct) BeforeUpdate()

type StrangeName

type StrangeName struct {
	Id_t int64 `xorm:"pk autoincr"`
	Name string
}

type StringPK

type StringPK struct {
	Id   string `xorm:"pk notnull"`
	Name string
}

type TTime

type TTime struct {
	Id int64
	T  time.Time
	Tz time.Time `xorm:"timestampz"`
}

type Uint32Id

type Uint32Id struct {
	Id   uint32 `xorm:"pk autoincr"`
	Name string
}

type Uint64Id

type Uint64Id struct {
	Id   uint64 `xorm:"pk autoincr"`
	Name string
}

type UintId

type UintId struct {
	Id   uint `xorm:"pk autoincr"`
	Name string
}

type User

type User struct {
	UserId   string `xorm:"varchar(19) not null pk"`
	NickName string `xorm:"varchar(19) not null"`
	GameId   uint32 `xorm:"integer pk"`
	Score    int32  `xorm:"integer"`
}

type UserCU

type UserCU struct {
	Id      int64
	Name    string
	Created time.Time `xorm:"created"`
	Updated time.Time `xorm:"updated"`
}

type Userdetail

type Userdetail struct {
	Id      int64
	Intro   string `xorm:"text"`
	Profile string `xorm:"varchar(2000)"`
}

type Userinfo

type Userinfo struct {
	Uid        int64  `xorm:"id pk not null autoincr"`
	Username   string `xorm:"unique"`
	Departname string
	Alias      string `xorm:"-"`
	Created    time.Time
	Detail     Userdetail `xorm:"detail_id int(11)"`
	Height     float64
	Avatar     []byte
	IsMan      bool
}

type VersionS

type VersionS struct {
	Id   int64
	Name string
	Ver  int `xorm:"version"`
}

Jump to

Keyboard shortcuts

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