This commit is contained in:
Nuno Cruces
2023-02-10 16:42:49 +00:00
parent eaf7cf57fd
commit a33b8d3459
10 changed files with 287 additions and 28 deletions

View File

@@ -13,6 +13,7 @@ type Error struct {
code uint64
str string
msg string
sql string
}
// Code returns the primary error code for this error.
@@ -49,6 +50,11 @@ func (e *Error) Error() string {
return b.String()
}
// SQL returns the SQL starting at the token that triggered a syntax error.
func (e *Error) SQL() string {
return e.sql
}
type errorString string
func (e errorString) Error() string { return string(e) }