Migrate to postgres

This commit is contained in:
Pijus Kamandulis
2026-08-08 01:26:32 +03:00
parent b8511f5ff8
commit 4fc3a7fb0a
12 changed files with 671 additions and 240 deletions
+3 -3
View File
@@ -9,18 +9,18 @@ import (
"fmt"
"github.com/gofrs/uuid/v5"
"github.com/ostafen/clover/v2"
"github.com/jackc/pgx/v5/pgxpool"
)
type WebServer struct {
db *clover.DB
db *pgxpool.Pool
port int
templates *template.Template
sessions map[string]string
adminPassword string
}
func NewWebServer(db *clover.DB, port int, adminPassword string) *WebServer {
func NewWebServer(db *pgxpool.Pool, port int, adminPassword string) *WebServer {
templates := template.New("base").Funcs(template.FuncMap{
"add": func(a, b int) int { return a + b },
"sub": func(a, b int) int { return a - b },