Fix for sql: converting argument $1 type: unsupported type []interface {}, a slice of interface in new notifications select

The sqlite3 version was just not working, original pr here: https://github.com/matrix-org/dendrite/pull/2688

signed off by: austin ellis <austin@hntlabs.com>
This commit is contained in:
texuf 2022-09-27 16:19:50 -07:00
parent 083ae01520
commit 885d5bb7c2

View file

@ -90,8 +90,8 @@ func (r *notificationDataStatements) SelectUserUnreadCountsForRooms(
for i := range roomIDs {
params[i+1] = roomIDs[i]
}
sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($1)", sqlutil.QueryVariadic(len(params)), 1)
rows, err := r.db.QueryContext(ctx, sql, params)
sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($2)", sqlutil.QueryVariadicOffset(len(roomIDs), 1), 1)
rows, err := r.db.QueryContext(ctx, sql, params...)
if err != nil {
return nil, err
}