mysqldb

package
v0.0.0-...-f492979 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDatabaseName

func CheckDatabaseName(databaseName string) bool

func CheckTableName

func CheckTableName(tableName string) bool

func EscapeApostrophes

func EscapeApostrophes(dataString string) string

func EscapeDoubleQuotes

func EscapeDoubleQuotes(dataString string) string

func EscapeMySQLString

func EscapeMySQLString(dataString string) string

func NullStringToString

func NullStringToString(nullString sql.NullString) string

Types

type MySQLdb

type MySQLdb struct {
	//--------------------
	Host string
	//--------------------
	User                 string
	Password             string
	AllowNativePasswords bool
	//--------------------
	Database string
	//--------------------
	AutoCreate bool
	//--------------------
	DB *sql.DB
}

func Connect

func Connect(conn MySQLdb, checkENV ...bool) (MySQLdb, error)

func (*MySQLdb) Close

func (conn *MySQLdb) Close() error

func (*MySQLdb) Connect

func (conn *MySQLdb) Connect(checkENV ...bool) error

func (*MySQLdb) Exec

func (conn *MySQLdb) Exec(query string, args ...any) (sql.Result, error)

func (*MySQLdb) GetRowsInfo

func (conn *MySQLdb) GetRowsInfo(rows *sql.Rows) (
	[]struct {
		Sequence int
		Name     string
		Type     string
	},
	map[string]string,
	error,
)

func (*MySQLdb) GetSQLTableInfo

func (conn *MySQLdb) GetSQLTableInfo(tableName string) (
	[]struct {
		Sequence int
		Name     string
		Type     string
	},
	map[string]string,
	error,
)

func (*MySQLdb) GetTableInfo

func (conn *MySQLdb) GetTableInfo(tableName string) (
	[]struct {
		Sequence int
		Name     string
		Type     string
	},
	map[string]string,
	error,
)

func (*MySQLdb) LockTables

func (conn *MySQLdb) LockTables(Tables ...string) error

func (*MySQLdb) Query

func (conn *MySQLdb) Query(query string, args ...any) (*sql.Rows, error)

func (*MySQLdb) QueryRecords

func (conn *MySQLdb) QueryRecords(query string, args ...any) ([]map[string]any, error)

func (*MySQLdb) QueryRow

func (conn *MySQLdb) QueryRow(query string, args ...any) *sql.Row

func (*MySQLdb) ScanRows

func (conn *MySQLdb) ScanRows(sqlRows *sql.Rows) ([]map[string]any, error)

func (*MySQLdb) ShowDatabases

func (conn *MySQLdb) ShowDatabases() ([]string, error)

func (*MySQLdb) ShowTables

func (conn *MySQLdb) ShowTables() ([]string, error)

func (*MySQLdb) ShowTablesMap

func (conn *MySQLdb) ShowTablesMap() (map[string]map[string]string, error)

func (*MySQLdb) TableExists

func (conn *MySQLdb) TableExists(tableName string) (bool, error)

func (*MySQLdb) UnlockTables

func (conn *MySQLdb) UnlockTables() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳