test

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package test 是用于辅助测试的包。仅限于内部使用

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEntity

type BaseEntity struct {
	CreateTime uint64
	UpdateTime uint64
}

type CombinedModel

type CombinedModel struct {
	BaseEntity
	Id        int64 `eorm:"auto_increment,primary_key"`
	FirstName string
	Age       int8
	LastName  *string
}

func NewCombinedModel

func NewCombinedModel(id int64) *CombinedModel

type JsonColumn

type JsonColumn struct {
	Val   User
	Valid bool
}

JsonColumn 是自定义的 JSON 类型字段 Val 字段必须是结构体指针

func (*JsonColumn) Scan

func (j *JsonColumn) Scan(src any) error

func (JsonColumn) Value

func (j JsonColumn) Value() (driver.Value, error)

Value 参考 sql.NullXXX 类型定义的

type SimpleStruct

type SimpleStruct struct {
	Id      uint64 `eorm:"primary_key,column=int_c"`
	Bool    bool
	BoolPtr *bool

	Int    int
	IntPtr *int

	Int8    int8 `eorm:"primary_key,column=int8_c"`
	Int8Ptr *int8

	Int16    int16
	Int16Ptr *int16

	Int32    int32
	Int32Ptr *int32

	Int64    int64
	Int64Ptr *int64

	Uint    uint
	UintPtr *uint

	Uint8    uint8
	Uint8Ptr *uint8

	Uint16    uint16
	Uint16Ptr *uint16

	Uint32    uint32
	Uint32Ptr *uint32

	Uint64    uint64
	Uint64Ptr *uint64

	Float32    float32
	Float32Ptr *float32

	Float64    float64
	Float64Ptr *float64

	// Byte byte
	// BytePtr *byte
	ByteArray []byte

	String string

	// 特殊类型
	NullStringPtr *sql.NullString
	NullInt16Ptr  *sql.NullInt16
	NullInt32Ptr  *sql.NullInt32
	NullInt64Ptr  *sql.NullInt64
	NullBoolPtr   *sql.NullBool
	// NullTimePtr    *sql.NullTime
	NullFloat64Ptr *sql.NullFloat64
	JsonColumn     *JsonColumn
}

SimpleStruct 包含所有 eorm 支持的类型

func NewSimpleStruct

func NewSimpleStruct(id uint64) *SimpleStruct

type User

type User struct {
	Name string
}

Jump to

Keyboard shortcuts

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