Add auth, rest api, svelte frontend, build structure

This commit is contained in:
2025-06-02 08:44:10 +02:00
parent 97be451306
commit 17ab7c4929
222 changed files with 3057 additions and 136 deletions

View File

@@ -3,6 +3,7 @@ package repository
import (
"database/sql"
"log/slog"
"os"
"sync"
)
@@ -21,6 +22,11 @@ func Connect(dsnURI string) {
}
repo = New(dbConn)
err = checkDBVersion(dbConn)
if err != nil {
slog.Error("DB Connection: Failed DB version check", "error", err)
os.Exit(1)
}
})
}
@@ -32,10 +38,11 @@ func GetConnection() (*sql.DB, error) {
return dbConn, nil
}
func GetRepository() (*Queries, error) {
func GetRepository() *Queries {
if repo == nil {
slog.Error("Database connection not initialized!")
os.Exit(1)
}
return repo, nil
return repo
}