aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2026-02-03 08:59:43 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2026-02-03 08:59:43 +0530
commit5cc5783f453ce68a5d5276ba9833ae1fb9acb3f9 (patch)
treeb212a2d633d83da2b464e2754ea9b86978b2f39f
parentab81e04e0090149aca6cba3f5154e91dc0cd6659 (diff)
printing entries in reverse order
-rw-r--r--cmd/dump.go4
1 files 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 <vidhukant@vidhukant.com>
+ * Copyright (C) 2025-2026 Vidhu Kant Sharma <vidhukant@vidhukant.com>
*
* 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)
}