Migrate to postgres
This commit is contained in:
+3
-3
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user