dex/db/conn_sqlite3.go

18 lines
298 B
Go
Raw Normal View History

// +build cgo
package db
// Register the sqlite3 driver.
import "github.com/mattn/go-sqlite3"
func init() {
registerAlreadyExistsChecker(func(err error) bool {
2016-06-29 04:39:20 +05:30
sqlErr, ok := err.(sqlite3.Error)
if !ok {
return false
}
return sqlErr.ExtendedCode == sqlite3.ErrConstraintUnique
})
}