Documentation ¶
Index ¶
- Constants
- type CommonDB
- type IAfterDelete
- type IAfterInsert
- type IAfterQuery
- type IAfterUpdate
- type IBeforeDelete
- type IBeforeInsert
- type IBeforeQuery
- type IBeforeUpdate
- 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 any) error
- func (s *Session) First(value any) error
- func (s *Session) HasTable() bool
- func (s *Session) Insert(values ...any) (int64, error)
- func (s *Session) Limit(num int) *Session
- func (s *Session) Model(value any) *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 ...any) *Session
- func (s *Session) RefTable() *schema.Schema
- func (s *Session) Rollback() (err error)
- func (s *Session) Update(kv ...any) (int64, error)
- func (s *Session) Where(desc string, args ...any) *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 ...any) (*sql.Rows, error) QueryRow(query string, args ...any) *sql.Row Exec(query string, args ...any) (sql.Result, error) }
CommonDB is a minimal function set of db
type IAfterDelete ¶
type IAfterInsert ¶
type IAfterQuery ¶
type IAfterUpdate ¶
type IBeforeDelete ¶
type IBeforeInsert ¶
type IBeforeQuery ¶
type IBeforeUpdate ¶
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.