session

package
v0.0.0-...-85f735d Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BeforeQuery  = "BeforeQuery"
	AfterQuery   = "AfterQuery"
	BeforeUpdate = "BeforeUpdate"
	AfterUpdate  = "AfterUpdate"
	BeforeDelete = "BeforeDelete"
	AfterDelete  = "AfterDelete"
	BeforeInsert = "BeforeInsert"
	AfterInsert  = "AfterInsert"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonDB

type CommonDB interface {
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Exec(query string, args ...interface{}) (sql.Result, error)
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB, dialect dialect.Dialect) *Session

func (*Session) Begin

func (s *Session) Begin() (err error)

func (*Session) CallMethod

func (s *Session) CallMethod(name string)

func (*Session) Clear

func (s *Session) Clear()

func (*Session) Commit

func (s *Session) Commit() (err error)

func (*Session) Count

func (s *Session) Count() (int64, error)

func (*Session) CreateTable

func (s *Session) CreateTable() error

func (*Session) DB

func (s *Session) DB() CommonDB

func (*Session) Delete

func (s *Session) Delete() (int64, error)

func (*Session) DropTable

func (s *Session) DropTable() error

func (*Session) Exec

func (s *Session) Exec() (result sql.Result, err error)

func (*Session) Find

func (s *Session) Find(args interface{}) error

func (*Session) First

func (s *Session) First(args interface{}) error

func (*Session) Insert

func (s *Session) Insert(values ...interface{}) (int64, error)

func (*Session) Limit

func (s *Session) Limit(args ...interface{}) *Session

func (*Session) Model

func (s *Session) Model(value interface{}) *Session

func (*Session) OrderBy

func (s *Session) OrderBy(args ...interface{}) *Session

func (*Session) QueryRow

func (s *Session) QueryRow() *sql.Row

func (*Session) QueryRows

func (s *Session) QueryRows() (rows *sql.Rows, err error)

func (*Session) Raw

func (s *Session) Raw(sql string, vars ...interface{}) *Session

func (*Session) RefTable

func (s *Session) RefTable() *schema.Schema

func (*Session) RollBack

func (s *Session) RollBack() (err error)

func (*Session) Update

func (s *Session) Update(values ...interface{}) (int64, error)

func (*Session) Where

func (s *Session) Where(query interface{}, args ...interface{}) *Session

Jump to

Keyboard shortcuts

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