This commit is contained in:
Nuno Cruces
2023-02-20 13:38:03 +00:00
parent 2f5b9837e1
commit df687a1c54
6 changed files with 61 additions and 6 deletions

View File

@@ -50,6 +50,11 @@ func (e *Error) Error() string {
return b.String()
}
// Temporary returns true for [BUSY] errors.
func (e *Error) Temporary() bool {
return e.Code() == BUSY
}
// SQL returns the SQL starting at the token that triggered a syntax error.
func (e *Error) SQL() string {
return e.sql
@@ -60,6 +65,7 @@ type errorString string
func (e errorString) Error() string { return string(e) }
const (
binaryErr = errorString("sqlite3: no SQLite binary embed/set/loaded")
nilErr = errorString("sqlite3: invalid memory address or null pointer dereference")
oomErr = errorString("sqlite3: out of memory")
rangeErr = errorString("sqlite3: index out of range")