refactor(backend): migrate from sql.ErrNoRows to pgx.ErrNoRows

Replace all database/sql.ErrNoRows checks with pgx.ErrNoRows across backend handlers.

Migration includes: jwt.go, local.go, admin_reserve.go, custom_services.go,
discount_campaigns.go, services.go, account.go, customer_relationship.go,
guest.go. Also removes unused test_helpers.go resetTestData function.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-20 16:58:08 +01:00
co-authored by Sisyphus
parent b03c4f6247
commit efd3ad5405
10 changed files with 24 additions and 26 deletions
+2 -2
View File
@@ -3,12 +3,12 @@ package auth
import (
"context"
"crypto/rand"
"database/sql"
"errors"
"fmt"
"time"
"crussell/db"
"github.com/jackc/pgx/v5"
"github.com/go-chi/jwtauth/v5"
)
@@ -196,7 +196,7 @@ func VerifyRefreshToken(ctx context.Context, tokenString string) (userID string,
err = db.DB.QueryRow(ctx, query, tokenString).Scan(&userID, &role)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
if errors.Is(err, pgx.ErrNoRows) {
return "", "", fmt.Errorf("invalid or expired refresh token")
}
return "", "", fmt.Errorf("failed to verify refresh token: %w", err)