Initial commit including .env

This commit is contained in:
2026-06-22 17:43:40 +05:30
commit c577d47b75
286 changed files with 85878 additions and 0 deletions

38
scratch/inspect_db.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
"fmt"
"log"
"doormile/config"
"doormile/db"
"github.com/joho/godotenv"
)
func main() {
_ = godotenv.Load()
cfg := config.Load()
db.Connect(cfg)
if db.DB == nil {
log.Fatal("DB connection is nil")
}
var tableNames []string
err := db.DB.Raw(`
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name;
`).Scan(&tableNames).Error
if err != nil {
log.Fatalf("Failed to query tables: %v", err)
}
fmt.Println("--- Tables in DB ---")
for _, name := range tableNames {
fmt.Println(name)
}
}