Documentation ¶
Index ¶
- Constants
- type Cache
- type Clause
- type DataSource
- func (ds *DataSource) Del(key string) error
- func (ds *DataSource) Exec(mapper SqlMapper, args interface{}) error
- func (ds *DataSource) ExecContext(ctx context.Context, mapper SqlMapper, arg interface{}) error
- func (ds *DataSource) ExecSql(query string, args ...interface{}) (sql.Result, error)
- func (ds *DataSource) Get(key string) (interface{}, error)
- func (ds *DataSource) MapperDir() string
- func (ds *DataSource) Query(dest interface{}, mapper SqlMapper, arg interface{}) error
- func (ds DataSource) QueryContext(ctx context.Context, dest interface{}, mapper SqlMapper, arg interface{}) error
- func (ds *DataSource) Set(key string, value interface{}) error
- func (ds *DataSource) Ttl(key string, value interface{}, duration time.Duration) error
- func (ds *DataSource) WithSqlHook(h ...SqlHookFunc)
- type DbConfig
- type Finder
- type Searcher
- type SqlHookFunc
- type SqlMapper
- type SqlType
- type StatementType
- type Updater
Constants ¶
View Source
const MaxIdleConns = 50
View Source
const MaxOpenConns = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
func NewDsDefaultCache ¶
func NewDsDefaultCache(cfg *DbConfig) (ds *DataSource, err error)
func (*DataSource) Del ¶
func (ds *DataSource) Del(key string) error
func (*DataSource) Exec ¶
func (ds *DataSource) Exec(mapper SqlMapper, args interface{}) error
update, delete
func (*DataSource) ExecContext ¶
func (ds *DataSource) ExecContext(ctx context.Context, mapper SqlMapper, arg interface{}) error
func (*DataSource) ExecSql ¶
func (ds *DataSource) ExecSql(query string, args ...interface{}) (sql.Result, error)
func (*DataSource) Get ¶
func (ds *DataSource) Get(key string) (interface{}, error)
func (*DataSource) MapperDir ¶
func (ds *DataSource) MapperDir() string
func (*DataSource) Query ¶
func (ds *DataSource) Query(dest interface{}, mapper SqlMapper, arg interface{}) error
Select using this DB.
func (DataSource) QueryContext ¶
func (ds DataSource) QueryContext(ctx context.Context, dest interface{}, mapper SqlMapper, arg interface{}) error
func (*DataSource) Set ¶
func (ds *DataSource) Set(key string, value interface{}) error
func (*DataSource) Ttl ¶
func (ds *DataSource) Ttl(key string, value interface{}, duration time.Duration) error
func (*DataSource) WithSqlHook ¶
func (ds *DataSource) WithSqlHook(h ...SqlHookFunc)
type DbConfig ¶
type DbConfig struct { DriverName string `mapstructure:"driverName"` Url string `mapstructure:"url"` MaxOpenConns int `mapstructure:"maxOpenConns"` MaxIdleConns int `mapstructure:"maxIdleConns"` MaxTransactionRetries int `mapstructure:"maxTransactionRetries"` // Mapper dir name MapperDir string `mapstructure:"mapperDir"` }
type StatementType ¶
type StatementType string
Directories ¶
Path | Synopsis |
---|---|
Package reflectx implements extensions to the standard reflect lib suitable for implementing marshalling and unmarshalling packages.
|
Package reflectx implements extensions to the standard reflect lib suitable for implementing marshalling and unmarshalling packages. |
Click to show internal directories.
Click to hide internal directories.