Documentation ¶
Index ¶
- func IsDuplicateEntryError(err errs.Err) bool
- func IsDuplicateExecError(err errs.Err) bool
- func SelectAll(structVal interface{}) string
- func SetOpener(opener Opener)
- func WithBeginEndHandler(handler func() (func(), error)) func(*ShardSet)
- func WithLogger(logger *log.Logger) func(*ShardSet)
- func WithMetricsHandler(handler func(query string, shardName string) func()) func(*ShardSet)
- func WithTLS(tls string) func(*ShardSet)
- type ConnVariables
- type Opener
- type Shard
- func (s *Shard) Exec(query string, args ...interface{}) (sql.Result, errs.Err)
- func (s *Shard) ExecIgnoreDuplicateError(query string, args ...interface{}) (res sql.Result, err errs.Err)
- func (s *Shard) Insert(query string, args ...interface{}) (id int64, err errs.Err)
- func (s *Shard) InsertIgnoreDuplicates(query string, args ...interface{}) (err errs.Err)
- func (s *Shard) InsertIgnoreId(query string, args ...interface{}) (err errs.Err)
- func (s *Shard) Query(query string, args ...interface{}) (*sql.Rows, errs.Err)
- func (s *Shard) Select(output interface{}, query string, args ...interface{}) errs.Err
- func (s *Shard) SelectInt(query string, args ...interface{}) (num int64, err errs.Err)
- func (s *Shard) SelectIntForce(query string, args ...interface{}) (num int64, err errs.Err)
- func (s *Shard) SelectIntMaybe(query string, args ...interface{}) (num int64, found bool, err errs.Err)
- func (s *Shard) SelectMaybe(output interface{}, query string, args ...interface{}) (found bool, err errs.Err)
- func (s *Shard) SelectOne(output interface{}, query string, args ...interface{}) (err errs.Err)
- func (s *Shard) SelectString(query string, args ...interface{}) (str string, err errs.Err)
- func (s *Shard) SelectStringForce(query string, args ...interface{}) (str string, err errs.Err)
- func (s *Shard) SelectStringMaybe(query string, args ...interface{}) (str string, found bool, err errs.Err)
- func (s *Shard) SelectUint(query string, args ...interface{}) (num uint, err errs.Err)
- func (s *Shard) SelectUintForce(query string, args ...interface{}) (num uint, err errs.Err)
- func (s *Shard) SelectUintMaybe(query string, args ...interface{}) (num uint, found bool, err errs.Err)
- func (s *Shard) Transact(txFun TxFunc) errs.Err
- func (s *Shard) TransactWithPropagatedErrors(txFun TxFunc) errs.Err
- func (s *Shard) Update(query string, args ...interface{}) (rowsAffected int64, err errs.Err)
- func (s *Shard) UpdateNum(num int64, query string, args ...interface{}) (err errs.Err)
- func (s *Shard) UpdateOne(query string, args ...interface{}) (err errs.Err)
- type ShardSet
- type TxFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDuplicateEntryError ¶
func IsDuplicateExecError ¶
func WithBeginEndHandler ¶
func WithLogger ¶
func WithMetricsHandler ¶
Types ¶
type ConnVariables ¶
func (ConnVariables) Join ¶
func (connVars ConnVariables) Join(sep string) string
type Shard ¶
type Shard struct { DBName string BeginEndHandler func() (func(), error) MetricsHandler func(query string, shardName string) func() // contains filtered or unexported fields }
func (*Shard) ExecIgnoreDuplicateError ¶
func (*Shard) InsertIgnoreDuplicates ¶
func (*Shard) InsertIgnoreId ¶
func (*Shard) SelectIntForce ¶
func (*Shard) SelectIntMaybe ¶
func (*Shard) SelectMaybe ¶
func (*Shard) SelectString ¶
func (*Shard) SelectStringForce ¶
func (*Shard) SelectStringMaybe ¶
func (*Shard) SelectUint ¶
func (*Shard) SelectUintForce ¶
func (*Shard) SelectUintMaybe ¶
func (*Shard) TransactWithPropagatedErrors ¶
type ShardSet ¶
type ShardSet struct {
// contains filtered or unexported fields
}
func NewShardSet ¶
func (*ShardSet) RandomShard ¶
Click to show internal directories.
Click to hide internal directories.