Chore: Disable cgo for postgres/mysql tests (#109444)
* disable cgo for postgres/mysql tests * add missing error constants
This commit is contained in:
@@ -2,7 +2,28 @@
|
||||
|
||||
package sqlite
|
||||
|
||||
import "modernc.org/sqlite"
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
|
||||
"modernc.org/sqlite"
|
||||
)
|
||||
|
||||
const DriverName = "sqlite"
|
||||
|
||||
// The errors below are used in tests to simulate specific SQLite errors. It's a temporary solution
|
||||
// until we rewrite the tests not to depend on the sqlite3 package internals directly.
|
||||
// Note: Since modernc.org/sqlite driver does not expose error codes like sqlite3, we cannot use the same approach.
|
||||
var (
|
||||
TestErrUniqueConstraintViolation = errors.New("unique constraint violation (simulated)")
|
||||
TestErrBusy = errors.New("database is busy (simulated)")
|
||||
TestErrLocked = errors.New("database is locked (simulated)")
|
||||
)
|
||||
|
||||
func init() {
|
||||
// alias the driver name to match the CGo driver
|
||||
sql.Register("sqlite3", &Driver{})
|
||||
}
|
||||
|
||||
//
|
||||
// FIXME (@zserge)
|
||||
|
||||
Reference in New Issue
Block a user