component: Add 'Snapshottable' component
This commit is contained in:
parent
1dac09bc03
commit
b6c36b5488
7 changed files with 28 additions and 13 deletions
|
|
@ -6,8 +6,8 @@ import (
|
|||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
// Snapshot makes a backup of the sql database into dest.
|
||||
func (sql SQL) Snapshot(io stream.IOStream, dest io.Writer, database string) error {
|
||||
// SnapshotDB makes a backup of the sql database into dest.
|
||||
func (sql SQL) SnapshotDB(io stream.IOStream, dest io.Writer, database string) error {
|
||||
io = io.Streams(dest, nil, nil, 0).NonInteractive()
|
||||
|
||||
code, err := sql.Stack(sql.Environment).Exec(io, "sql", "mysqldump", "--databases", database)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue