dbexplorer

package module
v0.0.0-...-1e758dd Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MPL-2.0 Imports: 3 Imported by: 0

README

dbexplorer

Scan your database and create code.

See gen.go for an example with administrative queries dumped to the command line.

Exact workings are undocumented so far, but generated code may be used somewhat like this:

// appendMystruct fetches Mystruct values from the database and appends them to dest.
func appendMystruct(dest []*Mystruct, db *sql.DB) []*Mystruct {
	bound := &Mystruct{}

	// Bind() creates an []interface{} for all fields in the struct
	dest := bound.Bind()

	// Query() fetches the sql query used to get struct instances
	// second arg is only used for variable identifiers like schemas, tables, users and hosts	
	query, _ := bound.Query()

	rows, err := db.Query(query)
	if err != nil {
		panic(err) // TODO fix
	}
	defer rows.Close() // TODO check error...

	for rows.Next() {
		err = rows.Scan(dest...)
		if err != nil {
			panic(err) // TODO fix
		}

		// copy() creates a shallow copy of the bound struct.
		// Doing it this way means the interface slice has to be created only once.
		dest = append(dest, bound.copy())
	}
	if err = rows.Err(); err != nil {
		panic(err) // TODO fix
	}
	return dest
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bindable

type Bindable interface {
	Bind() (cols []interface{})
	Copy() Bindable
	Query(location ...string) (sql string, args []string)
}

type CharacterSet

type CharacterSet struct {
	Charset          string `mysql:"Charset,VARCHAR(255) NOT NULL" json:"charset,omitempty" xml:"charset,omitempty"`
	Description      string `mysql:"Description,VARCHAR(255) NOT NULL" json:"description,omitempty" xml:"description,omitempty"`
	Defaultcollation string `mysql:"Default collation,VARCHAR(255) NOT NULL" json:"defaultcollation,omitempty" xml:"defaultcollation,omitempty"`
	Maxlen           int64  `mysql:"Maxlen,BIGINT NOT NULL" json:"maxlen,omitempty" xml:"maxlen,omitempty"`
}

func (*CharacterSet) Bind

func (v *CharacterSet) Bind() (cols []interface{})

Bind returns a slice of all columns for a CharacterSet to use it with Scan. Bind only one CharacterSet, reuse the []interface{} and store a copy after calling Scan.

func (*CharacterSet) Copy

func (v *CharacterSet) Copy() Bindable

Copy returns a shallow copy of the CharacterSet.

func (*CharacterSet) Query

func (v *CharacterSet) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for CharacterSet. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Collation

type Collation struct {
	Collation string `mysql:"Collation,VARCHAR(255) NOT NULL" json:"collation,omitempty" xml:"collation,omitempty"`
	Charset   string `mysql:"Charset,VARCHAR(255) NOT NULL" json:"charset,omitempty" xml:"charset,omitempty"`
	Id        int64  `mysql:"Id,BIGINT NOT NULL" json:"id,omitempty" xml:"id,omitempty"`
	Default   string `mysql:"Default,VARCHAR(255) NOT NULL" json:"default,omitempty" xml:"default,omitempty"`
	Compiled  string `mysql:"Compiled,VARCHAR(255) NOT NULL" json:"compiled,omitempty" xml:"compiled,omitempty"`
	Sortlen   int64  `mysql:"Sortlen,BIGINT NOT NULL" json:"sortlen,omitempty" xml:"sortlen,omitempty"`
}

func (*Collation) Bind

func (v *Collation) Bind() (cols []interface{})

Bind returns a slice of all columns for a Collation to use it with Scan. Bind only one Collation, reuse the []interface{} and store a copy after calling Scan.

func (*Collation) Copy

func (v *Collation) Copy() Bindable

Copy returns a shallow copy of the Collation.

func (*Collation) Query

func (v *Collation) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Collation. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Column

type Column struct {
	Field   string  `mysql:"Field,VARCHAR(255) NOT NULL" json:"field,omitempty" xml:"field,omitempty"`
	Type    []uint8 `mysql:"Type,BLOB NOT NULL" json:"type,omitempty" xml:"type,omitempty"`
	Null    string  `mysql:"Null,VARCHAR(255) NOT NULL" json:"null,omitempty" xml:"null,omitempty"`
	Key     string  `mysql:"Key,VARCHAR(255) NOT NULL" json:"key,omitempty" xml:"key,omitempty"`
	Default []uint8 `mysql:"Default,BLOB" json:"default,omitempty" xml:"default,omitempty"`
	Extra   string  `mysql:"Extra,VARCHAR(255) NOT NULL" json:"extra,omitempty" xml:"extra,omitempty"`
}

func (*Column) Bind

func (v *Column) Bind() (cols []interface{})

Bind returns a slice of all columns for a Column to use it with Scan. Bind only one Column, reuse the []interface{} and store a copy after calling Scan.

func (*Column) Copy

func (v *Column) Copy() Bindable

Copy returns a shallow copy of the Column.

func (*Column) Query

func (v *Column) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Column. It returns the SQL string and the arguments needed for prepared statements. Query panics if location is not schema, table string.

type Engine

type Engine struct {
	Engine       string         `mysql:"Engine,VARCHAR(255) NOT NULL" json:"engine,omitempty" xml:"engine,omitempty"`
	Support      string         `mysql:"Support,VARCHAR(255) NOT NULL" json:"support,omitempty" xml:"support,omitempty"`
	Comment      string         `mysql:"Comment,VARCHAR(255) NOT NULL" json:"comment,omitempty" xml:"comment,omitempty"`
	Transactions sql.NullString `mysql:"Transactions,VARCHAR(255)" json:"transactions,omitempty" xml:"transactions,omitempty"`
	XA           sql.NullString `mysql:"XA,VARCHAR(255)" json:"xa,omitempty" xml:"xa,omitempty"`
	Savepoints   sql.NullString `mysql:"Savepoints,VARCHAR(255)" json:"savepoints,omitempty" xml:"savepoints,omitempty"`
}

func (*Engine) Bind

func (v *Engine) Bind() (cols []interface{})

Bind returns a slice of all columns for a Engine to use it with Scan. Bind only one Engine, reuse the []interface{} and store a copy after calling Scan.

func (*Engine) Copy

func (v *Engine) Copy() Bindable

Copy returns a shallow copy of the Engine.

func (*Engine) Query

func (v *Engine) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Engine. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Error

type Error struct {
	Level   string `mysql:"Level,VARCHAR(255) NOT NULL" json:"level,omitempty" xml:"level,omitempty"`
	Code    uint32 `mysql:"Code,INT UNSIGNED NOT NULL" json:"code,omitempty" xml:"code,omitempty"`
	Message string `mysql:"Message,VARCHAR(255) NOT NULL" json:"message,omitempty" xml:"message,omitempty"`
}

func (*Error) Bind

func (v *Error) Bind() (cols []interface{})

Bind returns a slice of all columns for a Error to use it with Scan. Bind only one Error, reuse the []interface{} and store a copy after calling Scan.

func (*Error) Copy

func (v *Error) Copy() Bindable

Copy returns a shallow copy of the Error.

func (*Error) Query

func (v *Error) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Error. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type GlobalStatus

type GlobalStatus struct {
	Variablename string         `mysql:"Variable_name,VARCHAR(255) NOT NULL" json:"variablename,omitempty" xml:"variablename,omitempty"`
	Value        sql.NullString `mysql:"Value,VARCHAR(255)" json:"value,omitempty" xml:"value,omitempty"`
}

func (*GlobalStatus) Bind

func (v *GlobalStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a GlobalStatus to use it with Scan. Bind only one GlobalStatus, reuse the []interface{} and store a copy after calling Scan.

func (*GlobalStatus) Copy

func (v *GlobalStatus) Copy() Bindable

Copy returns a shallow copy of the GlobalStatus.

func (*GlobalStatus) Query

func (v *GlobalStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for GlobalStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type GlobalVariables

type GlobalVariables struct {
	Variablename string         `mysql:"Variable_name,VARCHAR(255) NOT NULL" json:"variablename,omitempty" xml:"variablename,omitempty"`
	Value        sql.NullString `mysql:"Value,VARCHAR(255)" json:"value,omitempty" xml:"value,omitempty"`
}

func (*GlobalVariables) Bind

func (v *GlobalVariables) Bind() (cols []interface{})

Bind returns a slice of all columns for a GlobalVariables to use it with Scan. Bind only one GlobalVariables, reuse the []interface{} and store a copy after calling Scan.

func (*GlobalVariables) Copy

func (v *GlobalVariables) Copy() Bindable

Copy returns a shallow copy of the GlobalVariables.

func (*GlobalVariables) Query

func (v *GlobalVariables) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for GlobalVariables. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Grant

type Grant struct {
	Grant string `mysql:"#Grant#,VARCHAR(255) NOT NULL" json:"grant,omitempty" xml:"grant,omitempty"`
}

func (*Grant) Bind

func (v *Grant) Bind() (cols []interface{})

Bind returns a slice of all columns for a Grant to use it with Scan. Bind only one Grant, reuse the []interface{} and store a copy after calling Scan.

func (*Grant) Copy

func (v *Grant) Copy() Bindable

Copy returns a shallow copy of the Grant.

func (*Grant) Query

func (v *Grant) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Grant. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Index

type Index struct {
	Table        string         `mysql:"Table,VARCHAR(255) NOT NULL" json:"table,omitempty" xml:"table,omitempty"`
	Nonunique    int64          `mysql:"Non_unique,BIGINT NOT NULL" json:"nonunique,omitempty" xml:"nonunique,omitempty"`
	Keyname      string         `mysql:"Key_name,VARCHAR(255) NOT NULL" json:"keyname,omitempty" xml:"keyname,omitempty"`
	Seqinindex   int64          `mysql:"Seq_in_index,BIGINT NOT NULL" json:"seqinindex,omitempty" xml:"seqinindex,omitempty"`
	Columnname   string         `mysql:"Column_name,VARCHAR(255) NOT NULL" json:"columnname,omitempty" xml:"columnname,omitempty"`
	Collation    sql.NullString `mysql:"Collation,VARCHAR(255)" json:"collation,omitempty" xml:"collation,omitempty"`
	Cardinality  sql.NullInt64  `mysql:"Cardinality,BIGINT" json:"cardinality,omitempty" xml:"cardinality,omitempty"`
	Subpart      sql.NullInt64  `mysql:"Sub_part,BIGINT" json:"subpart,omitempty" xml:"subpart,omitempty"`
	Packed       sql.NullString `mysql:"Packed,VARCHAR(255)" json:"packed,omitempty" xml:"packed,omitempty"`
	Null         string         `mysql:"Null,VARCHAR(255) NOT NULL" json:"null,omitempty" xml:"null,omitempty"`
	Indextype    string         `mysql:"Index_type,VARCHAR(255) NOT NULL" json:"indextype,omitempty" xml:"indextype,omitempty"`
	Comment      sql.NullString `mysql:"Comment,VARCHAR(255)" json:"comment,omitempty" xml:"comment,omitempty"`
	Indexcomment string         `mysql:"Index_comment,VARCHAR(255) NOT NULL" json:"indexcomment,omitempty" xml:"indexcomment,omitempty"`
}

func (*Index) Bind

func (v *Index) Bind() (cols []interface{})

Bind returns a slice of all columns for a Index to use it with Scan. Bind only one Index, reuse the []interface{} and store a copy after calling Scan.

func (*Index) Copy

func (v *Index) Copy() Bindable

Copy returns a shallow copy of the Index.

func (*Index) Query

func (v *Index) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Index. It returns the SQL string and the arguments needed for prepared statements. Query panics if location is not schema, table string.

type InnodbMutex

type InnodbMutex struct {
	Type   string `mysql:"Type,VARCHAR(255) NOT NULL" json:"type,omitempty" xml:"type,omitempty"`
	Name   string `mysql:"Name,VARCHAR(255) NOT NULL" json:"name,omitempty" xml:"name,omitempty"`
	Status string `mysql:"Status,VARCHAR(255) NOT NULL" json:"status,omitempty" xml:"status,omitempty"`
}

func (*InnodbMutex) Bind

func (v *InnodbMutex) Bind() (cols []interface{})

Bind returns a slice of all columns for a InnodbMutex to use it with Scan. Bind only one InnodbMutex, reuse the []interface{} and store a copy after calling Scan.

func (*InnodbMutex) Copy

func (v *InnodbMutex) Copy() Bindable

Copy returns a shallow copy of the InnodbMutex.

func (*InnodbMutex) Query

func (v *InnodbMutex) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for InnodbMutex. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type InnodbStatus

type InnodbStatus struct {
	Type   string `mysql:"Type,VARCHAR(255) NOT NULL" json:"type,omitempty" xml:"type,omitempty"`
	Name   string `mysql:"Name,VARCHAR(255) NOT NULL" json:"name,omitempty" xml:"name,omitempty"`
	Status string `mysql:"Status,VARCHAR(255) NOT NULL" json:"status,omitempty" xml:"status,omitempty"`
}

func (*InnodbStatus) Bind

func (v *InnodbStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a InnodbStatus to use it with Scan. Bind only one InnodbStatus, reuse the []interface{} and store a copy after calling Scan.

func (*InnodbStatus) Copy

func (v *InnodbStatus) Copy() Bindable

Copy returns a shallow copy of the InnodbStatus.

func (*InnodbStatus) Query

func (v *InnodbStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for InnodbStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type MasterStatus

type MasterStatus struct {
	File           string `mysql:"File,VARCHAR(255) NOT NULL" json:"file,omitempty" xml:"file,omitempty"`
	Position       uint64 `mysql:"Position,BIGINT UNSIGNED NOT NULL" json:"position,omitempty" xml:"position,omitempty"`
	BinlogDoDB     string `mysql:"Binlog_Do_DB,VARCHAR(255) NOT NULL" json:"binlogdodb,omitempty" xml:"binlogdodb,omitempty"`
	BinlogIgnoreDB string `mysql:"Binlog_Ignore_DB,VARCHAR(255) NOT NULL" json:"binlogignoredb,omitempty" xml:"binlogignoredb,omitempty"`
}

func (*MasterStatus) Bind

func (v *MasterStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a MasterStatus to use it with Scan. Bind only one MasterStatus, reuse the []interface{} and store a copy after calling Scan.

func (*MasterStatus) Copy

func (v *MasterStatus) Copy() Bindable

Copy returns a shallow copy of the MasterStatus.

func (*MasterStatus) Query

func (v *MasterStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for MasterStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type OpenTable

type OpenTable struct {
	Database   string `mysql:"Database,VARCHAR(255) NOT NULL" json:"database,omitempty" xml:"database,omitempty"`
	Table      string `mysql:"Table,VARCHAR(255) NOT NULL" json:"table,omitempty" xml:"table,omitempty"`
	Inuse      int64  `mysql:"In_use,BIGINT NOT NULL" json:"inuse,omitempty" xml:"inuse,omitempty"`
	Namelocked int64  `mysql:"Name_locked,BIGINT NOT NULL" json:"namelocked,omitempty" xml:"namelocked,omitempty"`
}

func (*OpenTable) Bind

func (v *OpenTable) Bind() (cols []interface{})

Bind returns a slice of all columns for a OpenTable to use it with Scan. Bind only one OpenTable, reuse the []interface{} and store a copy after calling Scan.

func (*OpenTable) Copy

func (v *OpenTable) Copy() Bindable

Copy returns a shallow copy of the OpenTable.

func (*OpenTable) Query

func (v *OpenTable) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for OpenTable. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Privilege

type Privilege struct {
	Privilege string `mysql:"Privilege,VARCHAR(255) NOT NULL" json:"privilege,omitempty" xml:"privilege,omitempty"`
	Context   string `mysql:"Context,VARCHAR(255) NOT NULL" json:"context,omitempty" xml:"context,omitempty"`
	Comment   string `mysql:"Comment,VARCHAR(255) NOT NULL" json:"comment,omitempty" xml:"comment,omitempty"`
}

func (*Privilege) Bind

func (v *Privilege) Bind() (cols []interface{})

Bind returns a slice of all columns for a Privilege to use it with Scan. Bind only one Privilege, reuse the []interface{} and store a copy after calling Scan.

func (*Privilege) Copy

func (v *Privilege) Copy() Bindable

Copy returns a shallow copy of the Privilege.

func (*Privilege) Query

func (v *Privilege) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Privilege. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Process

type Process struct {
	Id       int64          `mysql:"Id,BIGINT NOT NULL" json:"id,omitempty" xml:"id,omitempty"`
	User     string         `mysql:"User,VARCHAR(255) NOT NULL" json:"user,omitempty" xml:"user,omitempty"`
	Host     string         `mysql:"Host,VARCHAR(255) NOT NULL" json:"host,omitempty" xml:"host,omitempty"`
	Db       sql.NullString `mysql:"db,VARCHAR(255)" json:"db,omitempty" xml:"db,omitempty"`
	Command  string         `mysql:"Command,VARCHAR(255) NOT NULL" json:"command,omitempty" xml:"command,omitempty"`
	Time     int32          `mysql:"Time,INT NOT NULL" json:"time,omitempty" xml:"time,omitempty"`
	State    sql.NullString `mysql:"State,VARCHAR(255)" json:"state,omitempty" xml:"state,omitempty"`
	Info     sql.NullString `mysql:"Info,VARCHAR(255)" json:"info,omitempty" xml:"info,omitempty"`
	Progress float64        `mysql:"Progress,DOUBLE NOT NULL" json:"progress,omitempty" xml:"progress,omitempty"`
}

func (*Process) Bind

func (v *Process) Bind() (cols []interface{})

Bind returns a slice of all columns for a Process to use it with Scan. Bind only one Process, reuse the []interface{} and store a copy after calling Scan.

func (*Process) Copy

func (v *Process) Copy() Bindable

Copy returns a shallow copy of the Process.

func (*Process) Query

func (v *Process) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Process. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Schema

type Schema struct {
	Database string `mysql:"Database,VARCHAR(255) NOT NULL" json:"database,omitempty" xml:"database,omitempty"`
}

func (*Schema) Bind

func (v *Schema) Bind() (cols []interface{})

Bind returns a slice of all columns for a Schema to use it with Scan. Bind only one Schema, reuse the []interface{} and store a copy after calling Scan.

func (*Schema) Copy

func (v *Schema) Copy() Bindable

Copy returns a shallow copy of the Schema.

func (*Schema) Query

func (v *Schema) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Schema. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type SessionStatus

type SessionStatus struct {
	Variablename string         `mysql:"Variable_name,VARCHAR(255) NOT NULL" json:"variablename,omitempty" xml:"variablename,omitempty"`
	Value        sql.NullString `mysql:"Value,VARCHAR(255)" json:"value,omitempty" xml:"value,omitempty"`
}

func (*SessionStatus) Bind

func (v *SessionStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a SessionStatus to use it with Scan. Bind only one SessionStatus, reuse the []interface{} and store a copy after calling Scan.

func (*SessionStatus) Copy

func (v *SessionStatus) Copy() Bindable

Copy returns a shallow copy of the SessionStatus.

func (*SessionStatus) Query

func (v *SessionStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for SessionStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type SessionVariables

type SessionVariables struct {
	Variablename string         `mysql:"Variable_name,VARCHAR(255) NOT NULL" json:"variablename,omitempty" xml:"variablename,omitempty"`
	Value        sql.NullString `mysql:"Value,VARCHAR(255)" json:"value,omitempty" xml:"value,omitempty"`
}

func (*SessionVariables) Bind

func (v *SessionVariables) Bind() (cols []interface{})

Bind returns a slice of all columns for a SessionVariables to use it with Scan. Bind only one SessionVariables, reuse the []interface{} and store a copy after calling Scan.

func (*SessionVariables) Copy

func (v *SessionVariables) Copy() Bindable

Copy returns a shallow copy of the SessionVariables.

func (*SessionVariables) Query

func (v *SessionVariables) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for SessionVariables. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type SlaveHost

type SlaveHost struct {
	Serverid uint32 `mysql:"Server_id,INT UNSIGNED NOT NULL" json:"serverid,omitempty" xml:"serverid,omitempty"`
	Host     string `mysql:"Host,VARCHAR(255) NOT NULL" json:"host,omitempty" xml:"host,omitempty"`
	Port     uint32 `mysql:"Port,INT UNSIGNED NOT NULL" json:"port,omitempty" xml:"port,omitempty"`
	Masterid uint32 `mysql:"Master_id,INT UNSIGNED NOT NULL" json:"masterid,omitempty" xml:"masterid,omitempty"`
}

func (*SlaveHost) Bind

func (v *SlaveHost) Bind() (cols []interface{})

Bind returns a slice of all columns for a SlaveHost to use it with Scan. Bind only one SlaveHost, reuse the []interface{} and store a copy after calling Scan.

func (*SlaveHost) Copy

func (v *SlaveHost) Copy() Bindable

Copy returns a shallow copy of the SlaveHost.

func (*SlaveHost) Query

func (v *SlaveHost) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for SlaveHost. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type SlaveStatus

type SlaveStatus struct {
	SlaveIOState              string `mysql:"Slave_IO_State,VARCHAR(255) NOT NULL" json:"slaveiostate,omitempty" xml:"slaveiostate,omitempty"`
	MasterHost                string `mysql:"Master_Host,VARCHAR(255) NOT NULL" json:"masterhost,omitempty" xml:"masterhost,omitempty"`
	MasterUser                string `mysql:"Master_User,VARCHAR(255) NOT NULL" json:"masteruser,omitempty" xml:"masteruser,omitempty"`
	MasterPort                uint32 `mysql:"Master_Port,INT UNSIGNED NOT NULL" json:"masterport,omitempty" xml:"masterport,omitempty"`
	ConnectRetry              uint32 `mysql:"Connect_Retry,INT UNSIGNED NOT NULL" json:"connectretry,omitempty" xml:"connectretry,omitempty"`
	MasterLogFile             string `mysql:"Master_Log_File,VARCHAR(255) NOT NULL" json:"masterlogfile,omitempty" xml:"masterlogfile,omitempty"`
	ReadMasterLogPos          uint64 `mysql:"Read_Master_Log_Pos,BIGINT UNSIGNED NOT NULL" json:"readmasterlogpos,omitempty" xml:"readmasterlogpos,omitempty"`
	RelayLogFile              string `mysql:"Relay_Log_File,VARCHAR(255) NOT NULL" json:"relaylogfile,omitempty" xml:"relaylogfile,omitempty"`
	RelayLogPos               uint64 `mysql:"Relay_Log_Pos,BIGINT UNSIGNED NOT NULL" json:"relaylogpos,omitempty" xml:"relaylogpos,omitempty"`
	RelayMasterLogFile        string `mysql:"Relay_Master_Log_File,VARCHAR(255) NOT NULL" json:"relaymasterlogfile,omitempty" xml:"relaymasterlogfile,omitempty"`
	SlaveIORunning            string `mysql:"Slave_IO_Running,VARCHAR(255) NOT NULL" json:"slaveiorunning,omitempty" xml:"slaveiorunning,omitempty"`
	SlaveSQLRunning           string `mysql:"Slave_SQL_Running,VARCHAR(255) NOT NULL" json:"slavesqlrunning,omitempty" xml:"slavesqlrunning,omitempty"`
	ReplicateDoDB             string `mysql:"Replicate_Do_DB,VARCHAR(255) NOT NULL" json:"replicatedodb,omitempty" xml:"replicatedodb,omitempty"`
	ReplicateIgnoreDB         string `mysql:"Replicate_Ignore_DB,VARCHAR(255) NOT NULL" json:"replicateignoredb,omitempty" xml:"replicateignoredb,omitempty"`
	ReplicateDoTable          string `mysql:"Replicate_Do_Table,VARCHAR(255) NOT NULL" json:"replicatedotable,omitempty" xml:"replicatedotable,omitempty"`
	ReplicateIgnoreTable      string `` /* 127-byte string literal not displayed */
	ReplicateWildDoTable      string `` /* 128-byte string literal not displayed */
	ReplicateWildIgnoreTable  string `` /* 140-byte string literal not displayed */
	LastErrno                 uint32 `mysql:"Last_Errno,INT UNSIGNED NOT NULL" json:"lasterrno,omitempty" xml:"lasterrno,omitempty"`
	LastError                 string `mysql:"Last_Error,VARCHAR(255) NOT NULL" json:"lasterror,omitempty" xml:"lasterror,omitempty"`
	SkipCounter               uint32 `mysql:"Skip_Counter,INT UNSIGNED NOT NULL" json:"skipcounter,omitempty" xml:"skipcounter,omitempty"`
	ExecMasterLogPos          uint64 `mysql:"Exec_Master_Log_Pos,BIGINT UNSIGNED NOT NULL" json:"execmasterlogpos,omitempty" xml:"execmasterlogpos,omitempty"`
	RelayLogSpace             uint64 `mysql:"Relay_Log_Space,BIGINT UNSIGNED NOT NULL" json:"relaylogspace,omitempty" xml:"relaylogspace,omitempty"`
	UntilCondition            string `mysql:"Until_Condition,VARCHAR(255) NOT NULL" json:"untilcondition,omitempty" xml:"untilcondition,omitempty"`
	UntilLogFile              string `mysql:"Until_Log_File,VARCHAR(255) NOT NULL" json:"untillogfile,omitempty" xml:"untillogfile,omitempty"`
	UntilLogPos               uint64 `mysql:"Until_Log_Pos,BIGINT UNSIGNED NOT NULL" json:"untillogpos,omitempty" xml:"untillogpos,omitempty"`
	MasterSSLAllowed          string `mysql:"Master_SSL_Allowed,VARCHAR(255) NOT NULL" json:"mastersslallowed,omitempty" xml:"mastersslallowed,omitempty"`
	MasterSSLCAFile           string `mysql:"Master_SSL_CA_File,VARCHAR(255) NOT NULL" json:"mastersslcafile,omitempty" xml:"mastersslcafile,omitempty"`
	MasterSSLCAPath           string `mysql:"Master_SSL_CA_Path,VARCHAR(255) NOT NULL" json:"mastersslcapath,omitempty" xml:"mastersslcapath,omitempty"`
	MasterSSLCert             string `mysql:"Master_SSL_Cert,VARCHAR(255) NOT NULL" json:"mastersslcert,omitempty" xml:"mastersslcert,omitempty"`
	MasterSSLCipher           string `mysql:"Master_SSL_Cipher,VARCHAR(255) NOT NULL" json:"mastersslcipher,omitempty" xml:"mastersslcipher,omitempty"`
	MasterSSLKey              string `mysql:"Master_SSL_Key,VARCHAR(255) NOT NULL" json:"mastersslkey,omitempty" xml:"mastersslkey,omitempty"`
	SecondsBehindMaster       uint64 `` /* 127-byte string literal not displayed */
	MasterSSLVerifyServerCert string `` /* 144-byte string literal not displayed */
	LastIOErrno               uint32 `mysql:"Last_IO_Errno,INT UNSIGNED NOT NULL" json:"lastioerrno,omitempty" xml:"lastioerrno,omitempty"`
	LastIOError               string `mysql:"Last_IO_Error,VARCHAR(255) NOT NULL" json:"lastioerror,omitempty" xml:"lastioerror,omitempty"`
	LastSQLErrno              uint32 `mysql:"Last_SQL_Errno,INT UNSIGNED NOT NULL" json:"lastsqlerrno,omitempty" xml:"lastsqlerrno,omitempty"`
	LastSQLError              string `mysql:"Last_SQL_Error,VARCHAR(255) NOT NULL" json:"lastsqlerror,omitempty" xml:"lastsqlerror,omitempty"`
	ReplicateIgnoreServerIds  string `` /* 140-byte string literal not displayed */
	MasterServerId            uint32 `mysql:"Master_Server_Id,INT UNSIGNED NOT NULL" json:"masterserverid,omitempty" xml:"masterserverid,omitempty"`
	MasterSSLCrl              string `mysql:"Master_SSL_Crl,VARCHAR(255) NOT NULL" json:"mastersslcrl,omitempty" xml:"mastersslcrl,omitempty"`
	MasterSSLCrlpath          string `mysql:"Master_SSL_Crlpath,VARCHAR(255) NOT NULL" json:"mastersslcrlpath,omitempty" xml:"mastersslcrlpath,omitempty"`
	UsingGtid                 string `mysql:"Using_Gtid,VARCHAR(255) NOT NULL" json:"usinggtid,omitempty" xml:"usinggtid,omitempty"`
	GtidIOPos                 string `mysql:"Gtid_IO_Pos,VARCHAR(255) NOT NULL" json:"gtidiopos,omitempty" xml:"gtidiopos,omitempty"`
}

func (*SlaveStatus) Bind

func (v *SlaveStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a SlaveStatus to use it with Scan. Bind only one SlaveStatus, reuse the []interface{} and store a copy after calling Scan.

func (*SlaveStatus) Copy

func (v *SlaveStatus) Copy() Bindable

Copy returns a shallow copy of the SlaveStatus.

func (*SlaveStatus) Query

func (v *SlaveStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for SlaveStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type TableStatus

type TableStatus struct {
	Name          string         `mysql:"Name,VARCHAR(255) NOT NULL" json:"name,omitempty" xml:"name,omitempty"`
	Engine        sql.NullString `mysql:"Engine,VARCHAR(255)" json:"engine,omitempty" xml:"engine,omitempty"`
	Version       sql.NullInt64  `mysql:"Version,BIGINT UNSIGNED" json:"version,omitempty" xml:"version,omitempty"`
	Rowformat     sql.NullString `mysql:"Row_format,VARCHAR(255)" json:"rowformat,omitempty" xml:"rowformat,omitempty"`
	Rows          sql.NullInt64  `mysql:"Rows,BIGINT UNSIGNED" json:"rows,omitempty" xml:"rows,omitempty"`
	Avgrowlength  sql.NullInt64  `mysql:"Avg_row_length,BIGINT UNSIGNED" json:"avgrowlength,omitempty" xml:"avgrowlength,omitempty"`
	Datalength    sql.NullInt64  `mysql:"Data_length,BIGINT UNSIGNED" json:"datalength,omitempty" xml:"datalength,omitempty"`
	Maxdatalength sql.NullInt64  `mysql:"Max_data_length,BIGINT UNSIGNED" json:"maxdatalength,omitempty" xml:"maxdatalength,omitempty"`
	Indexlength   sql.NullInt64  `mysql:"Index_length,BIGINT UNSIGNED" json:"indexlength,omitempty" xml:"indexlength,omitempty"`
	Datafree      sql.NullInt64  `mysql:"Data_free,BIGINT UNSIGNED" json:"datafree,omitempty" xml:"datafree,omitempty"`
	Autoincrement sql.NullInt64  `mysql:"Auto_increment,BIGINT UNSIGNED" json:"autoincrement,omitempty" xml:"autoincrement,omitempty"`
	Createtime    mysql.NullTime `mysql:"Create_time,DATETIME" json:"createtime,omitempty" xml:"createtime,omitempty"`
	Updatetime    mysql.NullTime `mysql:"Update_time,DATETIME" json:"updatetime,omitempty" xml:"updatetime,omitempty"`
	Checktime     mysql.NullTime `mysql:"Check_time,DATETIME" json:"checktime,omitempty" xml:"checktime,omitempty"`
	Collation     sql.NullString `mysql:"Collation,VARCHAR(255)" json:"collation,omitempty" xml:"collation,omitempty"`
	Checksum      sql.NullInt64  `mysql:"Checksum,BIGINT UNSIGNED" json:"checksum,omitempty" xml:"checksum,omitempty"`
	Createoptions sql.NullString `mysql:"Create_options,VARCHAR(255)" json:"createoptions,omitempty" xml:"createoptions,omitempty"`
	Comment       string         `mysql:"Comment,VARCHAR(255) NOT NULL" json:"comment,omitempty" xml:"comment,omitempty"`
}

func (*TableStatus) Bind

func (v *TableStatus) Bind() (cols []interface{})

Bind returns a slice of all columns for a TableStatus to use it with Scan. Bind only one TableStatus, reuse the []interface{} and store a copy after calling Scan.

func (*TableStatus) Copy

func (v *TableStatus) Copy() Bindable

Copy returns a shallow copy of the TableStatus.

func (*TableStatus) Query

func (v *TableStatus) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for TableStatus. It returns the SQL string and the arguments needed for prepared statements. Query panics if location is not schema string.

type User

type User struct {
	User string `mysql:"user,CHAR BINARY NOT NULL" json:"user,omitempty" xml:"user,omitempty"`
	Host string `mysql:"host,CHAR BINARY NOT NULL" json:"host,omitempty" xml:"host,omitempty"`
}

func (*User) Bind

func (v *User) Bind() (cols []interface{})

Bind returns a slice of all columns for a User to use it with Scan. Bind only one User, reuse the []interface{} and store a copy after calling Scan.

func (*User) Copy

func (v *User) Copy() Bindable

Copy returns a shallow copy of the User.

func (*User) Query

func (v *User) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for User. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

type Warning

type Warning struct {
	Level   string `mysql:"Level,VARCHAR(255) NOT NULL" json:"level,omitempty" xml:"level,omitempty"`
	Code    uint32 `mysql:"Code,INT UNSIGNED NOT NULL" json:"code,omitempty" xml:"code,omitempty"`
	Message string `mysql:"Message,VARCHAR(255) NOT NULL" json:"message,omitempty" xml:"message,omitempty"`
}

func (*Warning) Bind

func (v *Warning) Bind() (cols []interface{})

Bind returns a slice of all columns for a Warning to use it with Scan. Bind only one Warning, reuse the []interface{} and store a copy after calling Scan.

func (*Warning) Copy

func (v *Warning) Copy() Bindable

Copy returns a shallow copy of the Warning.

func (*Warning) Query

func (v *Warning) Query(location ...string) (sql string, args []string)

Query provides sql metadata used to query for Warning. It returns the SQL string and the arguments needed for prepared statements. Query panics if arguments are given.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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