gomysql

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 4 Imported by: 1

README

GoMySQL

Build Status Go Report Card Docs License

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>

Documentation

Index

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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