further optimized database calls to replace all single-value QueryRowContext calls with GetContext

This commit is contained in:
2026-02-23 18:21:38 -07:00
parent 4113ba2fca
commit 220e1ecc98
14 changed files with 233 additions and 290 deletions
+1 -2
View File
@@ -273,8 +273,7 @@ func AmListIPBans(ctx context.Context) ([]IPBanEntry, error) {
// AmGetIPBan returns a single IP address ban structure.
func AmGetIPBan(ctx context.Context, id int32) (*IPBanEntry, error) {
var ban IPBanEntry
err := amdb.GetContext(ctx, &ban, "SELECT * FROM ipban WHERE id = ?", id)
if err != nil {
if err := amdb.GetContext(ctx, &ban, "SELECT * FROM ipban WHERE id = ?", id); err != nil {
return nil, err
}
return &ban, nil