mysql

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnInfo

type ColumnInfo struct {
	ColumnName string `db:"COLUMN_NAME"`
	ColumnKey  string `db:"COLUMN_KEY"`
	TableName  string `db:"TABLE_NAME"`
}

type Config

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

func NewConfigFromEnv

func NewConfigFromEnv() (*Config, error)

func (*Config) GetDBName

func (cfg *Config) GetDBName() string

func (*Config) ToDSN

func (cfg *Config) ToDSN() string

type DB

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

func NewDB

func NewDB(db *sqlx.DB) *DB

func OpenMySQLDB

func OpenMySQLDB(cfg *Config) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Exec

func (db *DB) Exec(query string) (sql.Result, error)

func (*DB) ExplainWithAnalyze

func (db *DB) ExplainWithAnalyze(query string) (string, error)

func (*DB) GetIndexes

func (db *DB) GetIndexes(database string, tables []string) ([]*IndexInfo, error)

func (*DB) GetTableColumns

func (db *DB) GetTableColumns(dbName string, tables []string) ([]*ColumnInfo, error)

type IndexInfo

type IndexInfo struct {
	TableName string
	Columns   []string
}

Jump to

Keyboard shortcuts

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