user

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Id
	Id = "id"
	//Name
	Name = "name"
	//Age
	Age = "age"
	//Ctime
	Ctime = "ctime"
	//Mtime
	Mtime = "mtime"
)
View Source
const (
	IdOp = xsql.FieldOp[int64](Id)

	NameOp = xsql.StrFieldOp(Name)

	AgeOp = xsql.FieldOp[int64](Age)

	CtimeOp = xsql.FieldOp[string](Ctime)

	MtimeOp = xsql.FieldOp[string](Mtime)
)

Variables

This section is empty.

Functions

func And

func And(predicates ...xsql.WhereFunc) xsql.WhereFunc

func Columns

func Columns() []string

func ColumnsSet

func ColumnsSet() map[string]struct{}

func Delete

func Delete(db xsql.ExecQuerier) *xsql.DeleteExecutor[*User]

func Find

func Not

func Not(predicate xsql.WhereFunc) xsql.WhereFunc

func Or

func Or(predicates ...xsql.WhereFunc) xsql.WhereFunc

Types

type Creater

type Creater struct {
	*xsql.InsertExecutor[*User]
}

func Create

func Create(db xsql.ExecQuerier) *Creater

func (*Creater) SetUser

func (c *Creater) SetUser(a ...*User) *Creater

type Updater

type Updater struct {
	*xsql.UpdateExecutor[*User]
}

func Update

func Update(db xsql.ExecQuerier) *Updater

func (*Updater) AddAge

func (u *Updater) AddAge(arg interface{}) *Updater

func (*Updater) SetAge

func (u *Updater) SetAge(arg int64) *Updater

func (*Updater) SetCtime

func (u *Updater) SetCtime(arg time.Time) *Updater

func (*Updater) SetId

func (u *Updater) SetId(arg int64) *Updater

func (*Updater) SetMtime

func (u *Updater) SetMtime(arg time.Time) *Updater

func (*Updater) SetName

func (u *Updater) SetName(arg string) *Updater

type User

type User struct {
	Id    int64     `json:"id"`    //
	Name  string    `json:"name"`  //
	Age   int64     `json:"age"`   //
	Ctime time.Time `json:"ctime"` //
	Mtime time.Time `json:"mtime"` //
}

func (*User) Columns

func (a *User) Columns() []string

func (*User) ColumnsSet

func (a *User) ColumnsSet() map[string]struct{}

func (*User) Dialect

func (a *User) Dialect() string

func (*User) GetAutoIncrPk

func (a *User) GetAutoIncrPk() (int64, string)

func (*User) IsNil

func (a *User) IsNil() bool

func (*User) NewPtr

func (a *User) NewPtr() any

func (*User) ScanDst

func (u *User) ScanDst(aa any, columns []string) []any

func (*User) Schema

func (a *User) Schema() string

func (*User) SetAutoIncrPk

func (a *User) SetAutoIncrPk(id int64)

func (*User) Table

func (a *User) Table() string

func (*User) Values

func (a *User) Values() []any

Jump to

Keyboard shortcuts

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