Add wait command (#35)

This commit is contained in:
Adrian Macneil 2018-04-15 18:37:57 -07:00 committed by GitHub
parent 6ba419a74b
commit cacf5de3ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 232 additions and 4 deletions

View file

@ -225,3 +225,15 @@ func (drv MySQLDriver) DeleteMigration(db Transaction, version string) error {
return err
}
// Ping verifies a connection to the database server. It does not verify whether the
// specified database exists.
func (drv MySQLDriver) Ping(u *url.URL) error {
db, err := drv.openRootDB(u)
if err != nil {
return err
}
defer mustClose(db)
return db.Ping()
}