mirror of https://github.com/pressly/goose.git
Embrace io.Reader
parent
94c2f51496
commit
3472cd6ee8
|
@ -59,7 +59,7 @@ func (m *Migration) run(db *sql.DB, direction bool) error {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
statements, useTx, err := parseSQLMigrationFile(f, direction)
|
||||
statements, useTx, err := parseSQLMigration(f, direction)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "ERROR %v: failed to parse SQL migration file", filepath.Base(m.Source))
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ var bufferPool = sync.Pool{
|
|||
// within a statement. For these cases, we provide the explicit annotations
|
||||
// 'StatementBegin' and 'StatementEnd' to allow the script to
|
||||
// tell us to ignore semicolons.
|
||||
func parseSQLMigrationFile(r io.Reader, direction bool) (stmts []string, useTx bool, err error) {
|
||||
func parseSQLMigration(r io.Reader, direction bool) (stmts []string, useTx bool, err error) {
|
||||
var buf bytes.Buffer
|
||||
scanBuf := bufferPool.Get().([]byte)
|
||||
defer bufferPool.Put(scanBuf)
|
||||
|
|
Loading…
Reference in New Issue