Versions in this module Expand all Collapse all v0 v0.3.1 Sep 21, 2023 Changes in this version + func GetNextSQLID() uint64 + type Config struct + ConnMaxLifetime time.Duration + ConnectString string + Dbname string + DriverName string + Host string + MaxIdleConns int + MaxOpenConns int + Name string + Pass string + Port string + SslMode string + User string + type DB struct + Name string + func New(cfg *Config, sqlStms SQLStms) (db *DB, myerr error) + func (db *DB) BeginTxx(ctx context.Context, externalId uint64, opts *sql.TxOptions) (tx *Tx, myerr error) + func (db *DB) Beginx(externalId uint64) (tx *Tx, myerr error) + func (db *DB) Close() (myerr error) + func (db *DB) Commit(externalId uint64, tx *Tx) (myerr error) + func (db *DB) Exec(externalId uint64, tx *Tx, sqlT string, args ...interface{}) (rowsAffected int64, lastInsertId int64, err error) + func (db *DB) Get(externalId uint64, tx *Tx, sqlT string, dest interface{}, args ...interface{}) (exists bool, myerr error) + func (db *DB) NamedExec(externalId uint64, tx *Tx, sqlT string, args interface{}) (rowsAffected int64, lastInsertId int64, myerr error) + func (db *DB) PreparexAddSql(sql string, needPrepare bool) (myerr error) + func (db *DB) PreparexAll(sqlStms SQLStms) (myerr error) + func (db *DB) QueryRowScan(externalId uint64, tx *Tx, sqlT string, dest []interface{}, ...) (exists bool, myerr error) + func (db *DB) QueryRowxStructScan(externalId uint64, tx *Tx, sqlT string, dest interface{}, args ...interface{}) (exists bool, myerr error) + func (db *DB) Rollback(externalId uint64, tx *Tx) (myerr error) + func (db *DB) Select(externalId uint64, tx *Tx, sqlT string, dest interface{}, args ...interface{}) (myerr error) + type SQLStm struct + NeedPrepare bool + Stmt *sqlx.Stmt + Text string + type SQLStms map[string]*SQLStm + type Tx struct