mysqlutil

package
v1.4.10 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireDb

func AcquireDb(dsn string) (*sqlx.DB, error)

获取数据库连接

func DeleteSql

func DeleteSql(dbTaggedObj interface{}, tableName string) (string, error)

func DeleteSqlM

func DeleteSqlM(objMap map[string]interface{}, tableName string) (string, error)

func InsertSql

func InsertSql(dbTaggedObj interface{}, tableName string) (string, error)

func InsertSqlM

func InsertSqlM(objMap map[string]interface{}, tableName string) (string, error)

func MySqlEscape

func MySqlEscape(noBackslashEscapes bool, v interface{}) (string, error)

func MySqlEscapeDefault

func MySqlEscapeDefault(noBackslashEscapes bool, v interface{}, defaultRet string) string

func MySqlMogrify

func MySqlMogrify(noBackslashEscapes bool, query string, args ...interface{}) (string, error)

func ReleaseDb

func ReleaseDb(conn *sqlx.DB)

连接放回pool

func SelectSql

func SelectSql(dbTaggedObj interface{}, tableName string, selectFields string) (string, error)

func SelectSqlM

func SelectSqlM(objMap map[string]interface{}, tableName string, selectFields string) (string, error)

func UpsertSql

func UpsertSql(dbTaggedObj interface{}, tableName string, keyFields []string) (string, error)

func UpsertSqlM

func UpsertSqlM(objMap map[string]interface{}, tableName string, keyFields []string) (string, error)

Types

type BusyPool

type BusyPool struct {
	// contains filtered or unexported fields
}

type ConnPair

type ConnPair struct {
	// contains filtered or unexported fields
}

type NullFloat added in v1.4.10

type NullFloat float64

func (*NullFloat) Scan added in v1.4.10

func (m *NullFloat) Scan(value interface{}) error

func (NullFloat) Value added in v1.4.10

func (m NullFloat) Value() (driver.Value, error)

type NullInt added in v1.4.10

type NullInt int64

func (*NullInt) Scan added in v1.4.10

func (m *NullInt) Scan(value interface{}) error

func (NullInt) Value added in v1.4.10

func (m NullInt) Value() (driver.Value, error)

type NullString added in v1.4.10

type NullString string

func (*NullString) Scan added in v1.4.10

func (m *NullString) Scan(value interface{}) error

func (NullString) Value added in v1.4.10

func (m NullString) Value() (driver.Value, error)

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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