README ¶ GoMySQL GoMySQL is a Go module that includes various helpers for MySQL, including mysqlvars, is a simple CLI app to dump the contents of SHOW VARIABLES for MySQL. It writes to STDOUT which can be piped to a file. CLI Installation and Usage % go install github.com/grokify/gomysql/cmd/mysqlvars@latest % mysqlvars -h <host> -P <port> -u <username> -p <password> Script Installation and Usage % git clone https://github.com/grokify/gomysql % cd gomysql/cmd/mysqlvars % go run main.go -h <host> -P <port> -u <username> -p <password> Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func GetInt(db *sql.DB, sqlQuery string) (int, error) func QueryVersion(db *sql.DB) (string, error) type Variable type Variables func QueryVariables(db *sql.DB) (Variables, error) func (vars Variables) Rows() [][]string func (vars Variables) WriteCSV(w io.Writer) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func GetInt ¶ func GetInt(db *sql.DB, sqlQuery string) (int, error) func QueryVersion ¶ func QueryVersion(db *sql.DB) (string, error) Types ¶ type Variable ¶ type Variable struct { Name string Value string } type Variables ¶ type Variables []Variable func QueryVariables ¶ func QueryVariables(db *sql.DB) (Variables, error) func (Variables) Rows ¶ func (vars Variables) Rows() [][]string func (Variables) WriteCSV ¶ func (vars Variables) WriteCSV(w io.Writer) error Source Files ¶ View all Source files query.go variables.go Directories ¶ Show internal Expand all Path Synopsis cmd mysqlvars Click to show internal directories. Click to hide internal directories.