mattn/go-sqlite3 — pull request #116 by c14n (2014-04-01 12:19:10+00:00)
Title: Enable extended error codes.

This pull request adds an additional field `ExtendedCode` for extended SQLite3 error codes as defined in https://www.sqlite.org/c3ref/c_abort_rollback.html to the `Error` type, and defines constants for those error types.

This pull request is fully backwards compatible with code like:

if err.(sqlite3.Error).Code == sqlite3.ErrConstraint {
// clumsily compare err.Error() against strings to figure out what the heck happened...
}

Additionally, the following is now possible:

if err.(sqlite3.Error).ExtendedCode == sqlite3.ErrConstraintUnique {
// oh! my unique constraint failed?
}

Cheers!