Versions in this module Expand all Collapse all v1 v1.0.0 Dec 2, 2018 Changes in this version + var ErrConcurrentTransaction = errors.New("database: concurrent transaction") + var ErrDone = errors.New("query has no more results") + var ErrNoSuchEntity = errors.New("database: no such entity") + func EscapeLike(str string) string + type Collection struct + func (c *Collection) Alias(alias string) *Collection + func (c *Collection) Clone() *Collection + func (c *Collection) Count() (int64, error) + func (c *Collection) Delete(instance Model) error + func (c *Collection) Filter(sql string, value interface{}) *Collection + func (c *Collection) FilterCond(condition Condition) *Collection + func (c *Collection) FilterExists(sub *Collection, join string) *Collection + func (c *Collection) FilterIsNil(column string) *Collection + func (c *Collection) FilterIsNotNil(column string) *Collection + func (c *Collection) First(instance Model) error + func (c *Collection) Get(instance Model) error + func (c *Collection) GetAll(models interface{}) error + func (c *Collection) GetMulti(keys interface{}, models interface{}) error + func (c *Collection) Iterator() (*Iterator, error) + func (c *Collection) Limit(limit int64) *Collection + func (c *Collection) Offset(offset int64) *Collection + func (c *Collection) Order(column string) *Collection + func (c *Collection) OrderSorter(sorter Sorter) *Collection + func (c *Collection) Put(instance Model) error + func (c *Collection) Truncate() error + type Condition interface + SQL func() string + Values func() []interface{} + func And(children []Condition) Condition + func CompareJSON(column, path string, value interface{}) Condition + func Filter(sql string, value interface{}) Condition + func FilterExists(sub *Collection, join string) Condition + func FilterIsNil(column string) Condition + func FilterIsNotNil(column string) Condition + func Or(children []Condition) Condition + type Credentials struct + Address string + Charset string + Collation string + Database string + Password string + Protocol string + User string + func (c Credentials) String() string + type Database struct + func Open(credentials Credentials, options ...Option) (*Database, error) + func (db *Database) Close() + func (db *Database) Collection(model Model) *Collection + func (db *Database) Exec(query string, params ...interface{}) error + func (db *Database) QueryRow(query string, params ...interface{}) *sql.Row + type Iterator struct + func (it *Iterator) Close() + func (it *Iterator) Next(model Model) error + type Model interface + TableName func() string + Tracking func() *ModelTracking + type ModelTracking struct + Revision int64 + func (tracking *ModelTracking) AfterDelete(props []*Property) error + func (tracking *ModelTracking) AfterGet(props []*Property) error + func (tracking *ModelTracking) AfterPut(props []*Property) error + func (tracking *ModelTracking) IsInserted() bool + func (tracking *ModelTracking) StoredRevision() int64 + func (tracking *ModelTracking) Tracking() *ModelTracking + type MultiError []error + func (merr MultiError) Error() string + func (merr MultiError) HasError() bool + type OnAfterPutHooker interface + OnAfterPutHook func() error + type OnBeforePutHooker interface + OnBeforePutHook func() error + type Option func(db *Database) + func WithDebug(debug bool) Option + type Property struct + Field string + Name string + OmitEmpty bool + Pointer interface{} + PrimaryKey bool + Value interface{} + type Sorter interface + SQL func() string