dao

package
v0.0.0-...-1dd3e1b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnSupportedDatabase = errors.New("database is not supported now")
	UpdateParamsError   = errors.New("you must provide update column and value")
	StructError         = errors.New("you must provide the same struct")
)

Functions

This section is empty.

Types

type Columns

type Columns map[string]interface{}

type Cursor

type Cursor struct {
	*gorm.DB
	// contains filtered or unexported fields
}
var (
	Conn *Cursor
)

func NewConnect

func NewConnect(cfg conf.SqlConfig) (cur *Cursor, err error)

func (*Cursor) Delete

func (c *Cursor) Delete(v interface{}, where ...interface{}) error

func (*Cursor) Find

func (c *Cursor) Find(out interface{}, where ...interface{}) *Cursor

func (*Cursor) FindPagination

func (c *Cursor) FindPagination(page, pageSize int, out interface{}, where ...interface{}) *Cursor

find with pagination

func (*Cursor) FindPaginationAndOrder

func (c *Cursor) FindPaginationAndOrder(page, pageSize int, order string, out interface{}, where ...interface{}) (int, error)

find with order

func (*Cursor) Insert

func (c *Cursor) Insert(v interface{}) error

func (*Cursor) Like

func (c *Cursor) Like(field, name string) *Cursor

func (*Cursor) Llike

func (c *Cursor) Llike(field, name string) *Cursor

func (*Cursor) Page

func (c *Cursor) Page(current, pageSize int) *Cursor

func (*Cursor) Rlike

func (c *Cursor) Rlike(field, name string) *Cursor

func (*Cursor) Save

func (c *Cursor) Save(v interface{}) error

func (*Cursor) Select

func (c *Cursor) Select(query interface{}, args ...interface{}) *Cursor

func (*Cursor) Sql

func (c *Cursor) Sql(v interface{}, sql string, params ...interface{}) error

func (*Cursor) Table

func (c *Cursor) Table(name string) *Cursor

func (*Cursor) Updates

func (c *Cursor) Updates(v interface{}, attrs ...interface{}) (int64, error)

Jump to

Keyboard shortcuts

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