Documentation ¶
Index ¶
- func Decode(src string) string
- func Encode(src string) string
- func IsErrNotFound(err error) bool
- func MsSQLOffsetLimit(offset, limit int) string
- func MsSQLTimeFormat(t interface{}) string
- func MsSQLTimeParse(s string) time.Time
- func NewStringSlice(len int, val string) []string
- func PrimaryComparator(a, b interface{}) int
- func SQLOffsetLimit(offset, limit int) string
- func SQLOrderBy(field string, revert bool) string
- func SQLWhere(conditions []string) string
- func SliceJoin(objs []interface{}, sep string) string
- func StringScan(str string, v interface{}) error
- func TimeFormat(t time.Time) string
- func TimeParse(s string) time.Time
- func TimeParseLocalTime(s string) time.Time
- func TimeToLocalTime(c time.Time) string
- func ToFloat64(value interface{}) (float64, error)
- func Transact(db *DBStore, t Transactor) error
- func TransactFunc(db *DBStore, txFunc func(*DBTx) error) (err error)
- type DB
- type DBStore
- func (store *DBStore) AddWrappers(wp ...database.Wrapper)
- func (store *DBStore) BeginTx() (*DBTx, error)
- func (store *DBStore) Close() error
- func (store *DBStore) Debug(b bool)
- func (store *DBStore) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (store *DBStore) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (store *DBStore) Query(sql string, args ...interface{}) (*sql.Rows, error)
- func (store *DBStore) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (store *DBStore) SetError(err error)
- func (store *DBStore) SlowLog(duration time.Duration)
- type DBTx
- func (tx *DBTx) Close() error
- func (tx *DBTx) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (tx *DBTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx *DBTx) Query(sql string, args ...interface{}) (*sql.Rows, error)
- func (tx *DBTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (tx *DBTx) SetError(err error)
- type FieldIN
- type FieldMultiIN
- type RedisStore
- func NewRedisClient(host string, port int, password string, db int) (*RedisStore, error)
- func NewRedisClusterClient(opt *redis.ClusterOptions) (*RedisStore, error)
- func NewRedisFailoverClient(failoverOpt *redis.FailoverOptions) (*RedisStore, error)
- func NewRedisRingClient(opt *redis.RingOptions) (*RedisStore, error)
- type Transactor
- type VSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrNotFound ¶ added in v1.5.1
IsErrNotFound represents the mysql db rows not found error should be compatible with FetchByPrimaryKey and FetchByPK
func MsSQLOffsetLimit ¶
func MsSQLTimeFormat ¶
func MsSQLTimeFormat(t interface{}) string
func MsSQLTimeParse ¶
func NewStringSlice ¶
func PrimaryComparator ¶
func PrimaryComparator(a, b interface{}) int
func SQLOffsetLimit ¶
func SQLOrderBy ¶
func StringScan ¶
func TimeFormat ¶
func TimeParseLocalTime ¶
func TimeToLocalTime ¶
func Transact ¶ added in v1.5.0
func Transact(db *DBStore, t Transactor) error
Types ¶
type DB ¶
type DB interface { Query(sql string, args ...interface{}) (*sql.Rows, error) Exec(sql string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error) ExecContext(ctx context.Context, sql string, args ...interface{}) (sql.Result, error) SetError(err error) }
type DBStore ¶
func NewDBDSNStore ¶ added in v1.5.0
func NewDBStore ¶
func NewDBStoreCharset ¶ added in v1.0.3
func NewDBStoreWithRawDB ¶ added in v1.5.0
func (*DBStore) AddWrappers ¶ added in v1.5.0
func (*DBStore) ExecContext ¶ added in v1.5.0
func (*DBStore) QueryContext ¶ added in v1.5.0
type DBTx ¶
type DBTx struct {
// contains filtered or unexported fields
}
func (*DBTx) ExecContext ¶ added in v1.5.0
func (*DBTx) QueryContext ¶ added in v1.5.0
type FieldIN ¶ added in v1.0.4
type FieldIN struct { Field string Params []interface{} // contains filtered or unexported fields }
func NewFieldIN ¶ added in v1.0.4
type FieldMultiIN ¶ added in v1.5.2
type FieldMultiIN struct {
// contains filtered or unexported fields
}
func NewMultiFieldIN ¶ added in v1.5.2
func NewMultiFieldIN(fields []string) *FieldMultiIN
func (*FieldMultiIN) Add ¶ added in v1.5.2
func (in *FieldMultiIN) Add(v []interface{}) error
func (*FieldMultiIN) SQLFormat ¶ added in v1.5.2
func (in *FieldMultiIN) SQLFormat() string
func (*FieldMultiIN) SQLParams ¶ added in v1.5.2
func (in *FieldMultiIN) SQLParams() []interface{}
type RedisStore ¶
type RedisStore struct {
redis.Cmdable
}
func NewRedisClient ¶
func NewRedisClusterClient ¶
func NewRedisClusterClient(opt *redis.ClusterOptions) (*RedisStore, error)
func NewRedisFailoverClient ¶
func NewRedisFailoverClient(failoverOpt *redis.FailoverOptions) (*RedisStore, error)
func NewRedisRingClient ¶
func NewRedisRingClient(opt *redis.RingOptions) (*RedisStore, error)
type Transactor ¶ added in v1.5.0
Click to show internal directories.
Click to hide internal directories.