mattn/go-sqlite3 — pull request #130 by shuhaowu (2014-07-10 20:25:52+00:00)
Title: Added an IsDone method for backup

A quick glance at the sqlite3 [api for backup step](http://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep), it shows that `.Step()` may return `SQLITE_DONE`, which under the current scenario will just be an unknown error.

This fixes this and also adds a `IsDone` method to check easily:

for {
err = bk.Step(pagerate)
if err != nil {
sqlErr := err.(sqlite3.Error)
if int(sqlErr.Code) == SQLITE_DONE {
break
} else {
panic(err)
}
}

Can be rewritten as:

for {
err = bk.Step(pagerate)
if err != nil {
if sqlite3.IsDone(err) {
break
} else {
panic(err)
}
}

This patch doesn't change interface, either.