From 84bdcd8ce6d1579fb7afd0e3c9b7a19b8b4d50df Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Mon, 13 Oct 2025 15:03:11 -0400 Subject: [PATCH] Setting back to functioning route --- internal/data/movies.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/data/movies.go b/internal/data/movies.go index 08c8bfa..4a939b6 100644 --- a/internal/data/movies.go +++ b/internal/data/movies.go @@ -52,23 +52,23 @@ func (m MovieModel) Get(ctx context.Context, id int64) (*Movie, error) { return nil, ErrRecordNotFound } - // query := ` - // SELECT id, created_at, title, year, runtime, genres, version - // FROM movies - // WHERE id = $1 - // ` - // Mimicking a long running query. FYI since this changes the number of returned - // fields, so I implmented the throwaway variable to take care of that query := ` - SELECT pg_sleep(8), id, created_at, title, year, runtime, genres, version + SELECT id, created_at, title, year, runtime, genres, version FROM movies WHERE id = $1 ` + // Mimicking a long running query. FYI since this changes the number of returned + // fields, so I implmented the throwaway variable to take care of that + // query := ` + // SELECT pg_sleep(8), id, created_at, title, year, runtime, genres, version + // FROM movies + // WHERE id = $1 + // ` var movie Movie err := m.pool.QueryRow(ctx, query, id).Scan( - &[]byte{}, // throwaway the pg_sleep value + // &[]byte{}, // throwaway the pg_sleep value &movie.ID, &movie.CreatedAt, &movie.Title,