Towards virtual tables.

This commit is contained in:
Nuno Cruces
2023-11-16 01:16:38 +00:00
parent 314098addb
commit 787086b8c1
17 changed files with 317 additions and 97 deletions

View File

@@ -1,6 +1,7 @@
package sqlite3
import (
"errors"
"strconv"
"strings"
@@ -135,3 +136,18 @@ func (e ExtendedErrorCode) Temporary() bool {
func (e ExtendedErrorCode) Timeout() bool {
return e == BUSY_TIMEOUT
}
func errorCode(err error, def ErrorCode) (code uint32) {
var ecode ErrorCode
var xcode xErrorCode
switch {
case errors.As(err, &xcode):
return uint32(xcode)
case errors.As(err, &ecode):
return uint32(ecode)
}
if err != nil {
return uint32(def)
}
return _OK
}