sqlx

package
v0.0.0-...-1a2806f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLConnection

type SQLConnection struct {
	Nodes []database.NodeInfo
	// contains filtered or unexported fields
}

SQLConnection connect to db by dsn

func NewSQLConnection

func NewSQLConnection(nodes []database.NodeInfo) (*SQLConnection, error)

NewSQLConnection create redis cache instance

func (*SQLConnection) Close

func (s *SQLConnection) Close()

Close close SQLConnection

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) ExecTX

func (s *SQLConnection) ExecTX(querys []string) error

ExecTX exec tx

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) Open

func (s *SQLConnection) Open() error

Open connect and ping

func (*SQLConnection) Ping

func (s *SQLConnection) Ping() error

Ping test SQLConnection

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL