initial commit

This commit is contained in:
Odweta
2026-03-19 09:23:13 +01:00
commit 12def174a4
7 changed files with 184 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package main
import (
"context"
"fmt"
"os"
"github.com/jackc/pgx/v5"
)
var db *pgx.Conn
func connectDB() {
var err error
connStr := os.Getenv("DB_URL")
if connStr == "" {
panic("DB_URL not set")
}
db, err = pgx.Connect(context.Background(), connStr)
if err != nil {
panic(err)
}
fmt.Println("Connected to PostgreSQL")
}