aboutsummaryrefslogtreecommitdiff
path: root/database/functions.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-06 23:01:58 +0530
committerBobby <[email protected]>2026-03-06 23:01:58 +0530
commited2a033d7c08e448f5c6fd035e2de8f51431b597 (patch)
treeabe46463fc761b2e4266aadedb6b88c5493ce29b /database/functions.go
parent3f07a4b6c745707f135a7a97e93b0fa770b67873 (diff)
downloaddove-ed2a033d7c08e448f5c6fd035e2de8f51431b597.tar.xz
dove-ed2a033d7c08e448f5c6fd035e2de8f51431b597.zip
Implement database connection and routing system with HTTP method support
Diffstat (limited to 'database/functions.go')
-rw-r--r--database/functions.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/database/functions.go b/database/functions.go
new file mode 100644
index 0000000..71723ca
--- /dev/null
+++ b/database/functions.go
@@ -0,0 +1,22 @@
+package database
+
+import (
+ "path/filepath"
+
+ "dove/config"
+
+ "gorm.io/gorm/logger"
+)
+
+func resolveDatabasePath() string {
+ return filepath.Join(config.DataDir, DATABASE_FILE_NAME)
+}
+
+func resolveGORMLogLevel() logger.Interface {
+ switch config.Server.Debug {
+ case true:
+ return logger.Default.LogMode(logger.Info)
+ default:
+ return logger.Default.LogMode(logger.Silent)
+ }
+}