Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpAllTables ¶
DumpAllTables will dump a database, content and structure to io.Writer
Types ¶
type MySQLDump ¶
type MySQLDump struct {
// contains filtered or unexported fields
}
MySQLDump is actually, the only dumper released.. perhaps will build new ones on future. to init it, just, create a new type:
dumper := sqldump.NewMySQLDump(db *db.DB, w io.Writer) and use it.
on apps directory i will build some examples... a commandline tool for downloading databases from server... a web tool, for the same prupose..
func (MySQLDump) DumpCreateTable ¶
DumpCreateTable dumps sql table structure to w struct
func (MySQLDump) DumpEnd ¶
func (t MySQLDump) DumpEnd()
DumpInit adds variables at the end of a dump
func (MySQLDump) DumpInit ¶
func (t MySQLDump) DumpInit()
DumpInit adds variables at begining of a dump
func (MySQLDump) DumpTableData ¶
DumpTableData will dump data for a given table
func (MySQLDump) GetColumnsFromTable ¶
GetColumnsFromTable returns the column names of a give table
type SQLDumper ¶
type SQLDumper interface { GetTables() ([]string, error) GetColumnsFromTable(table string) ([]string, error) DumpCreateTable(table string) error DumpTableData(table string) error DumpInit() DumpEnd() }
SQLDumper is an interface that can be implemented by and used by apps, that will dump database contents to io.Writer