From 5cc5783f453ce68a5d5276ba9833ae1fb9acb3f9 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 3 Feb 2026 08:59:43 +0530 Subject: printing entries in reverse order --- cmd/dump.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index ddc26e8..769c4bc 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -1,5 +1,5 @@ /* guestbook - Standalone guestbook server for static websites - * Copyright (C) 2025 Vidhu Kant Sharma + * Copyright (C) 2025-2026 Vidhu Kant Sharma * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ var dumpCmd = &cobra.Command{ conn := db.Connect() defer conn.Close() - rows, err := conn.Query(fmt.Sprintf("SELECT name, website, message, time FROM %s", guestbookName)) + rows, err := conn.Query(fmt.Sprintf("SELECT name, website, message, time FROM %s ORDER BY time DESC", guestbookName)) if err != nil { log.Fatal(err) } -- cgit v1.2.3