aboutsummaryrefslogtreecommitdiff
path: root/database/comments.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-07-07 22:57:31 +0530
committerBobby <[email protected]>2025-07-07 22:57:31 +0530
commit52a0248c1c81a14699b3d33ba7efe0c56bbe7477 (patch)
tree02d35fee769d518beb5dd01715e84d13ea421d51 /database/comments.go
parentb6a04140f2668a0dcae4befcd272e05b75bd14e5 (diff)
downloadimageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.tar.xz
imageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.zip
massive y2k retro overhaul with sidebar, context processors, and proper database organization
Diffstat (limited to 'database/comments.go')
-rw-r--r--database/comments.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/database/comments.go b/database/comments.go
new file mode 100644
index 0000000..1203be4
--- /dev/null
+++ b/database/comments.go
@@ -0,0 +1,11 @@
+package database
+
+import (
+ "imageboard/models"
+)
+
+func GetTotalCommentsCount() (int64, error) {
+ var count int64
+ err := DB.Model(&models.Comment{}).Count(&count).Error
+ return count, err
+}