Documentation ¶
Index ¶
- Constants
- type CommonDB
- type Session
- func (s *Session) Begin() (err error)
- func (s *Session) CallMethod(method string, value interface{})
- func (s *Session) Clear()
- func (s *Session) Commit() (err error)
- func (s *Session) Count() (int64, error)
- func (s *Session) CreateTable() error
- func (s *Session) DB() CommonDB
- func (s *Session) Delete() (int64, error)
- func (s *Session) DropTable() error
- func (s *Session) Exec() (result sql.Result, err error)
- func (s *Session) Find(values interface{}) error
- func (s *Session) First(value interface{}) error
- func (s *Session) HasTable() bool
- func (s *Session) Insert(values ...interface{}) (int64, error)
- func (s *Session) Limit(num int) *Session
- func (s *Session) Model(value interface{}) *Session
- func (s *Session) OrderBy(desc string) *Session
- func (s *Session) QueryRow() *sql.Row
- func (s *Session) QueryRows() (rows *sql.Rows, err error)
- func (s *Session) Raw(sql string, values ...interface{}) *Session
- func (s *Session) RefTable() *schema.Schema
- func (s *Session) Rollback() (err error)
- func (s *Session) Update(kv ...interface{}) (int64, error)
- func (s *Session) Where(desc string, args ...interface{}) *Session
Constants ¶
View Source
const ( BeforeQuery = "BeforeQuery" AfterQuery = "AfterQuery" BeforeUpdate = "BeforeUpdate" AfterUpdate = "AfterUpdate" BeforeDelete = "BeforeDelete" AfterDelete = "AfterDelete" BeforeInsert = "BeforeInsert" AfterInsert = "AfterInsert" )
Hooks constants
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) }
CommonDB is a minimal function set of db
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) CallMethod ¶
CallMethod calls the registered hooks
func (*Session) CreateTable ¶
Click to show internal directories.
Click to hide internal directories.