appview/db: fix comparing against []byte #440

merged
opened by winter.bsky.social targeting master from winter.bsky.social/core: push-xqqzsrpkuoqz

SQLite stores byte sequences as blobs, which we were not handling properly, causing (at least) actions relating to artifacts to break. (Not sure when they broke, sorry!)

Signed-off-by: Winter winter@winter.cafe

Changed files
+2 -2
appview
db
+2 -2
appview/db/db.go
···
kind := rv.Kind()
// if we have `FilterIn(k, [1, 2, 3])`, compile it down to `k in (?, ?, ?)`
-
if kind == reflect.Slice || kind == reflect.Array {
+
if (kind == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8) || kind == reflect.Array {
if rv.Len() == 0 {
// always false
return "1 = 0"
···
func (f filter) Arg() []any {
rv := reflect.ValueOf(f.arg)
kind := rv.Kind()
-
if kind == reflect.Slice || kind == reflect.Array {
+
if (kind == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8) || kind == reflect.Array {
if rv.Len() == 0 {
return nil
}