gomysqlclient

package module
v0.0.0-...-3d77b25 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 12 Imported by: 0

README

go-mysql-client

pure Go mysql client

Feature

  • Single binary
  • Complete table name
  • Complete MySQL reserved words

Demo

Install

go get -u github.com/johejo/go-mysql-client/cmd/gomysql

Usage

execute SQL

gomysql -h [HOST] -P [PORT] -u [USER] -p [PASSWORD] [DATABASE] "[SQL]" 

prompt

gomysql -h [HOST] -P [PORT] -u [USER] -p [PASSWORD] [DATABASE] 

reading file

gomysql -h [HOST] -P [PORT] -u [USER] -p [PASSWORD] -f [SQL_FILE] [DATABASE] 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueriesFromReader

func QueriesFromReader(r io.Reader) []string

Types

type Cli

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

func NewCli

func NewCli(c *Config) (*Cli, error)

func (*Cli) Run

func (c *Cli) Run(execute ...string) error

func (*Cli) RunPrompt

func (c *Cli) RunPrompt() error

type Config

type Config struct {
	Host     string
	Port     uint
	User     string
	Password string
	Database string
}

func (*Config) String

func (c *Config) String() string

type Results

type Results struct {
	Columns []string
	Rows    [][]string
}

func (*Results) String

func (r *Results) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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