Documentation
¶
Index ¶
- Constants
- Variables
- func CreateTable(csql string, o orm.Ormer, dbindex string) (err error)
- func ExecSql(config ExecSqlConfig) (err error)
- func FindOne(config QueryConfig, result interface{}, args ...interface{}) (err error)
- func GenCacheKey(sql string, args []interface{}) string
- func HashCode(sql string, args []interface{}) int
- func HashCodeOfArg(arg interface{}) int
- func InitMysqls(conns []MapMysqlConn, cachedb string) (err error)
- func Query(config QueryConfig, result interface{}, args ...interface{}) (err error)
- func QueryWithCache(config QueryCacheConfig, result interface{}, args ...interface{}) (err error)
- func ReadFilesql(pth, tbname string) (sql string, err error)
- type ExecSqlConfig
- type MapMysqlConn
- type QueryCacheConfig
- type QueryConfig
Constants ¶
View Source
const ( DEFAULT_EXPIRE = 300 //默认缓存5分钟 DEFAULT_MAXCOUNT = 100 //默认最大条数 )
Variables ¶
View Source
var LXMYSQLCACHEDB string //默认缓存数据库
Functions ¶
func ExecSql ¶
func ExecSql(config ExecSqlConfig) (err error)
func FindOne ¶
func FindOne(config QueryConfig, result interface{}, args ...interface{}) (err error)
FindOne 查询一条数据
func InitMysqls ¶
func InitMysqls(conns []MapMysqlConn, cachedb string) (err error)
InitMysqls 初始化MySQL
func Query ¶
func Query(config QueryConfig, result interface{}, args ...interface{}) (err error)
Query 查询数据
func QueryWithCache ¶
func QueryWithCache(config QueryCacheConfig, result interface{}, args ...interface{}) (err error)
QueryWithCache 查询数据
func ReadFilesql ¶
Types ¶
type ExecSqlConfig ¶
type MapMysqlConn ¶
type QueryCacheConfig ¶
Click to show internal directories.
Click to hide internal directories.