Documentation ¶
Index ¶
- Variables
- func LogInit(t int)
- type Config
- type DB
- func (db *DB) Begin() (tx *Tx, err error)
- func (db *DB) Exec(sql string, params ...interface{}) (ret sql.Result, err error)
- func (db *DB) Insert(obj interface{}) (id int64, err error)
- func (db *DB) InsertOrUpdate(obj interface{}) (id int64, err error)
- func (db *DB) Query(sql string, params ...interface{}) (rows *sql.Rows, err error)
- func (db *DB) Update(obj interface{}) (id int64, err error)
- type Rows
- type Tx
- func (tx *Tx) Commit() (err error)
- func (tx *Tx) Exec(sql string, params ...interface{}) (ret sql.Result, err error)
- func (tx *Tx) Insert(obj interface{}) (id int64, err error)
- func (tx *Tx) InsertOrUpdate(obj interface{}) (id int64, err error)
- func (tx *Tx) Query(sql string, params ...interface{}) (rows *sql.Rows, err error)
- func (tx *Tx) Rollback() (err error)
- func (tx *Tx) Update(obj interface{}) (id int64, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Tag = "gorm" TableName = "TableName" )
Functions ¶
Types ¶
type Config ¶
type Config struct { DSN string // write data source name. ReadDSN []string // read data source name. Active int // pool Idle int // pool // contains filtered or unexported fields }
Config mysql config struct
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB sql db struct
func (*DB) InsertOrUpdate ¶
InsertOrUpdate InsertOrUpdate
Click to show internal directories.
Click to hide internal directories.