summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/internal
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-11-05 21:58:38 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:12:41 +0100
commitd0c551acb5ab79efafd325f5b19c76a3de835356 (patch)
treeba9462cdc5081015fbd6bf5d98d9f39334d13207 /vendor/github.com/ncruces/go-sqlite3/internal
parent[performance] when transforming media, perform read operations of large files... (diff)
downloadgotosocial-d0c551acb5ab79efafd325f5b19c76a3de835356.tar.xz
[chore] update dependencies (#4542)
- github.com/minio/minio-go/v7: v7.0.95 -> v7.0.97 - github.com/ncruces/go-sqlite3: v0.29.1 -> v0.30.0 - github.com/tdewolff/minify/v2: v2.24.5 -> v2.24.6 - codeberg.org/gruf/go-mmap: fixes build for BSD platforms Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4542 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/internal')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/internal/util/const.go5
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/internal/util/error.go10
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/internal/util/module.go18
3 files changed, 30 insertions, 3 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/internal/util/const.go b/vendor/github.com/ncruces/go-sqlite3/internal/util/const.go
index 5e89018dd..031a702b9 100644
--- a/vendor/github.com/ncruces/go-sqlite3/internal/util/const.go
+++ b/vendor/github.com/ncruces/go-sqlite3/internal/util/const.go
@@ -39,6 +39,9 @@ const (
ERROR_MISSING_COLLSEQ = ERROR | (1 << 8)
ERROR_RETRY = ERROR | (2 << 8)
ERROR_SNAPSHOT = ERROR | (3 << 8)
+ ERROR_RESERVESIZE = ERROR | (4 << 8)
+ ERROR_KEY = ERROR | (5 << 8)
+ ERROR_UNABLE = ERROR | (6 << 8)
IOERR_READ = IOERR | (1 << 8)
IOERR_SHORT_READ = IOERR | (2 << 8)
IOERR_WRITE = IOERR | (3 << 8)
@@ -73,6 +76,8 @@ const (
IOERR_DATA = IOERR | (32 << 8)
IOERR_CORRUPTFS = IOERR | (33 << 8)
IOERR_IN_PAGE = IOERR | (34 << 8)
+ IOERR_BADKEY = IOERR | (35 << 8)
+ IOERR_CODEC = IOERR | (36 << 8)
LOCKED_SHAREDCACHE = LOCKED | (1 << 8)
LOCKED_VTAB = LOCKED | (2 << 8)
BUSY_RECOVERY = BUSY | (1 << 8)
diff --git a/vendor/github.com/ncruces/go-sqlite3/internal/util/error.go b/vendor/github.com/ncruces/go-sqlite3/internal/util/error.go
index 76769ed2e..d9bce5b80 100644
--- a/vendor/github.com/ncruces/go-sqlite3/internal/util/error.go
+++ b/vendor/github.com/ncruces/go-sqlite3/internal/util/error.go
@@ -33,8 +33,12 @@ func AssertErr() ErrorString {
return ErrorString(msg)
}
-func ErrorCodeString(rc uint32) string {
- switch rc {
+type errorCode interface {
+ ~uint8 | ~uint16 | ~uint32 | ~int32
+}
+
+func ErrorCodeString[T errorCode](rc T) string {
+ switch uint32(rc) {
case ABORT_ROLLBACK:
return "sqlite3: abort due to ROLLBACK"
case ROW:
@@ -42,7 +46,7 @@ func ErrorCodeString(rc uint32) string {
case DONE:
return "sqlite3: no more rows available"
}
- switch rc & 0xff {
+ switch uint8(rc) {
case OK:
return "sqlite3: not an error"
case ERROR:
diff --git a/vendor/github.com/ncruces/go-sqlite3/internal/util/module.go b/vendor/github.com/ncruces/go-sqlite3/internal/util/module.go
index ba5754a32..a308b4e23 100644
--- a/vendor/github.com/ncruces/go-sqlite3/internal/util/module.go
+++ b/vendor/github.com/ncruces/go-sqlite3/internal/util/module.go
@@ -12,6 +12,7 @@ type ConnKey struct{}
type moduleKey struct{}
type moduleState struct {
+ sysError error
mmapState
handleState
}
@@ -23,3 +24,20 @@ func NewContext(ctx context.Context) context.Context {
ctx = context.WithValue(ctx, moduleKey{}, state)
return ctx
}
+
+func GetSystemError(ctx context.Context) error {
+ // Test needed to simplify testing.
+ s, ok := ctx.Value(moduleKey{}).(*moduleState)
+ if ok {
+ return s.sysError
+ }
+ return nil
+}
+
+func SetSystemError(ctx context.Context, err error) {
+ // Test needed to simplify testing.
+ s, ok := ctx.Value(moduleKey{}).(*moduleState)
+ if ok {
+ s.sysError = err
+ }
+}