Versions in this module Expand all Collapse all v1 v1.1.0 Dec 5, 2018 v1.0.0 Nov 30, 2018 Changes in this version + type DB struct + func NewDB(opts ...Option) (*DB, error) + func (d *DB) Close() error + func (d *DB) CreateTableIfNotExists(i interface{}, name string) + func (d *DB) CreateTableIndex(table, idx string, unique bool, columns ...string) + func (d *DB) DeleteByPK(table string, pk M) (int64, error) + func (d *DB) DeleteByPKWithTran(tran *gorp.Transaction, table string, pk M) (int64, error) + func (d *DB) DeleteSQL(table string, pk M) (string, []interface{}) + func (d *DB) In(query string, args ...interface{}) (string, []interface{}, error) + func (d *DB) InsertM(table string, info M) (int64, error) + func (d *DB) InsertMWithTran(tran *gorp.Transaction, table string, info M) (int64, error) + func (d *DB) InsertSQL(table string, info M) (string, []interface{}) + func (d *DB) UpdateByPK(table string, pk, info M) (int64, error) + func (d *DB) UpdateByPKWithTran(tran *gorp.Transaction, table string, pk, info M) (int64, error) + func (d *DB) UpdateSQL(table string, pk, info M) (string, []interface{}) + type Logger interface + Printf func(format string, args ...interface{}) + type M map[string]interface + type Option func(*options) + func SetDSN(dsn string) Option + func SetEncoding(encoding string) Option + func SetEngine(engine string) Option + func SetLogger(logger Logger) Option + func SetMaxIdleConns(maxIdleConns int) Option + func SetMaxLifetime(maxLifetime time.Duration) Option + func SetMaxOpenConns(maxOpenConns int) Option + func SetTrace(t bool) Option