Versions in this module Expand all Collapse all v1 v1.1.5 May 4, 2019 v1.1.4 Mar 24, 2019 v1.1.3 Feb 27, 2019 v1.1.2 Dec 24, 2018 v1.1.1 Oct 2, 2018 v1.1.0 Sep 16, 2018 v1.0.0 Sep 4, 2018 Changes in this version + func ClearModels() + type AfterFetcher = fetch.AfterFetcher + type BeforeInserter interface + BeforeInsert func() error + type BeforeUpdater interface + BeforeUpdate func() error + type Column struct + Default string + GoName string + GoType reflect.Type + HasDefault bool + Len1 int + Len2 int + Name string + Nullable bool + func (c *Column) IsAI() bool + func (c *Column) IsZero(v reflect.Value) bool + type DB struct + func NewDB(driverName, dataSourceName, tablePrefix string, dialect Dialect) (*DB, error) + func NewDBWithStdDB(db *sql.DB, tablePrefix string, dialect Dialect) (*DB, error) + func (db *DB) Begin() (*Tx, error) + func (db *DB) Close() error + func (db *DB) Count(v interface{}) (int64, error) + func (db *DB) Create(v interface{}) error + func (db *DB) Delete(v interface{}) (sql.Result, error) + func (db *DB) Dialect() Dialect + func (db *DB) Drop(v interface{}) error + func (db *DB) Exec(query string, args ...interface{}) (sql.Result, error) + func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (db *DB) Insert(v interface{}) (sql.Result, error) + func (db *DB) LastInsertID(v interface{}) (int64, error) + func (db *DB) MultCreate(objs ...interface{}) error + func (db *DB) MultDelete(objs ...interface{}) error + func (db *DB) MultDrop(objs ...interface{}) error + func (db *DB) MultInsert(objs ...interface{}) error + func (db *DB) MultSelect(objs ...interface{}) error + func (db *DB) MultTruncate(objs ...interface{}) error + func (db *DB) MultUpdate(objs ...interface{}) error + func (db *DB) Prepare(query string) (*sql.Stmt, error) + func (db *DB) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) + func (db *DB) Query(query string, args ...interface{}) (*sql.Rows, error) + func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (db *DB) QueryRow(query string, args ...interface{}) *sql.Row + func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + func (db *DB) SQL() *SQL + func (db *DB) Select(v interface{}) error + func (db *DB) StdDB() *sql.DB + func (db *DB) Truncate(v interface{}) error + func (db *DB) Update(v interface{}, cols ...string) (sql.Result, error) + type Dialect interface + CreateTableSQL func(m *Model) ([]string, error) + QuoteTuple func() (openQuote, closeQuote byte) + SQL func(sql string) (string, error) + TransactionalDDL func() bool + TruncateTableSQL func(m *Model) []string + type Engine interface + Count func(v interface{}) (int64, error) + Create func(v interface{}) error + Delete func(v interface{}) (sql.Result, error) + Dialect func() Dialect + Drop func(v interface{}) error + Insert func(v interface{}) (sql.Result, error) + LastInsertID func(v interface{}) (int64, error) + MultCreate func(objs ...interface{}) error + MultDelete func(objs ...interface{}) error + MultDrop func(objs ...interface{}) error + MultInsert func(objs ...interface{}) error + MultSelect func(objs ...interface{}) error + MultTruncate func(objs ...interface{}) error + MultUpdate func(objs ...interface{}) error + SQL func() *SQL + Select func(v interface{}) error + Truncate func(v interface{}) error + Update func(v interface{}, cols ...string) (sql.Result, error) + type ForeignKey struct + Col *Column + DeleteRule string + RefColName string + RefTableName string + UpdateRule string + type Metaer interface + Meta func() string + type Model struct + AI *Column + Check map[string]string + Cols map[string]*Column + FK map[string]*ForeignKey + KeyIndexes map[string][]*Column + Meta map[string][]string + Name string + OCC *Column + PK []*Column + UniqueIndexes map[string][]*Column + func NewModel(obj interface{}) (*Model, error) + type SQL struct + func (sql *SQL) CreateIndex() *sqlbuilder.CreateIndexStmt + func (sql *SQL) Delete() *sqlbuilder.DeleteStmt + func (sql *SQL) DropTable() *sqlbuilder.DropTableStmt + func (sql *SQL) Insert() *sqlbuilder.InsertStmt + func (sql *SQL) Select() *sqlbuilder.SelectStmt + func (sql *SQL) Update() *sqlbuilder.UpdateStmt + type Tx struct + func (tx *Tx) Commit() error + func (tx *Tx) Count(v interface{}) (int64, error) + func (tx *Tx) Create(v interface{}) error + func (tx *Tx) Delete(v interface{}) (sql.Result, error) + func (tx *Tx) Dialect() Dialect + func (tx *Tx) Drop(v interface{}) error + func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error) + func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (tx *Tx) ForUpdate(v interface{}) error + func (tx *Tx) Insert(v interface{}) (sql.Result, error) + func (tx *Tx) InsertMany(v interface{}) error + func (tx *Tx) LastInsertID(v interface{}) (int64, error) + func (tx *Tx) MultCreate(objs ...interface{}) error + func (tx *Tx) MultDelete(objs ...interface{}) error + func (tx *Tx) MultDrop(objs ...interface{}) error + func (tx *Tx) MultInsert(objs ...interface{}) error + func (tx *Tx) MultSelect(objs ...interface{}) error + func (tx *Tx) MultTruncate(objs ...interface{}) error + func (tx *Tx) MultUpdate(objs ...interface{}) error + func (tx *Tx) Prepare(query string) (*sql.Stmt, error) + func (tx *Tx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) + func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error) + func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (tx *Tx) QueryRow(query string, args ...interface{}) *sql.Row + func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + func (tx *Tx) Rollback() error + func (tx *Tx) SQL() *SQL + func (tx *Tx) Select(v interface{}) error + func (tx *Tx) StdTx() *sql.Tx + func (tx *Tx) Truncate(v interface{}) error + func (tx *Tx) Update(v interface{}, cols ...string) (sql.Result, error) Other modules containing this package github.com/issue9/orm/v2 github.com/issue9/orm/v3 github.com/issue9/orm/v4 github.com/issue9/orm/v5 github.com/issue9/orm/v6