mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-16 01:43:48 +01:00
Add wait command (#35)
This commit is contained in:
parent
6ba419a74b
commit
cacf5de3ec
11 changed files with 232 additions and 4 deletions
|
|
@ -164,3 +164,16 @@ func (drv SQLiteDriver) DeleteMigration(db Transaction, version string) error {
|
|||
|
||||
return err
|
||||
}
|
||||
|
||||
// Ping verifies a connection to the database. Due to the way SQLite works, by
|
||||
// testing whether the database is valid, it will automatically create the database
|
||||
// if it does not already exist.
|
||||
func (drv SQLiteDriver) Ping(u *url.URL) error {
|
||||
db, err := drv.Open(u)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer mustClose(db)
|
||||
|
||||
return db.Ping()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue