Documentation ¶
Index ¶
- type SQLConnection
- func (s *SQLConnection) Close()
- func (s *SQLConnection) CreateTx() (*sqlx.Tx, error)
- func (s *SQLConnection) Exec(query string, args ...interface{}) (sql.Result, error)
- func (s *SQLConnection) ExecTX(querys []string) error
- func (s *SQLConnection) Get(dest interface{}, query string, args ...interface{}) error
- func (s *SQLConnection) IsErrNoRows(err error) bool
- func (s *SQLConnection) Open() error
- func (s *SQLConnection) Ping() error
- func (s *SQLConnection) Query(query string, args ...interface{}) (*sqlx.Rows, error)
- func (s *SQLConnection) QueryRow(query string, args ...interface{}) *sqlx.Row
- func (s *SQLConnection) Select(dest interface{}, query string, args ...interface{}) error
- func (s *SQLConnection) Setup(nodes []database.NodeInfo) (*SQLConnection, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLConnection ¶
SQLConnection connect to db by dsn
func NewSQLConnection ¶
func NewSQLConnection(nodes []database.NodeInfo) (*SQLConnection, error)
NewSQLConnection create redis cache instance
func (*SQLConnection) CreateTx ¶
func (s *SQLConnection) CreateTx() (*sqlx.Tx, error)
CreateTx create sqlx tx
func (*SQLConnection) Exec ¶
func (s *SQLConnection) Exec(query string, args ...interface{}) (sql.Result, error)
Exec process sql and get result
func (*SQLConnection) Get ¶
func (s *SQLConnection) Get(dest interface{}, query string, args ...interface{}) error
Get get struct
func (*SQLConnection) IsErrNoRows ¶
func (s *SQLConnection) IsErrNoRows(err error) bool
IsErrNoRows 判断是否有数据
func (*SQLConnection) Query ¶
func (s *SQLConnection) Query(query string, args ...interface{}) (*sqlx.Rows, error)
Query sql and return rows
func (*SQLConnection) QueryRow ¶
func (s *SQLConnection) QueryRow(query string, args ...interface{}) *sqlx.Row
QueryRow by sql
func (*SQLConnection) Select ¶
func (s *SQLConnection) Select(dest interface{}, query string, args ...interface{}) error
Select select operate
func (*SQLConnection) Setup ¶
func (s *SQLConnection) Setup(nodes []database.NodeInfo) (*SQLConnection, error)
Setup init cache with config
Click to show internal directories.
Click to hide internal directories.