feat: Initialized Project
Build / test-and-build (scribblers-linux-x64, ubuntu-latest) (push) Has been cancelled
Build / test-and-build (scribblers-macos-x64, macos-latest) (push) Has been cancelled
Build / test-and-build (scribblers-x64.exe, windows-latest) (push) Has been cancelled

This commit is contained in:
2026-05-09 09:36:38 +03:30
commit ff300a5e84
121 changed files with 46171 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package database
import (
"context"
"log"
"github.com/jackc/pgx/v5/pgxpool"
)
var Pool *pgxpool.Pool
func ConnectToDB(connection_string string) {
var err error
Pool, err = pgxpool.New(context.Background(), connection_string)
if err != nil {
log.Fatalf("Unable to create connection pool: %v", err)
}
// Test the connection
err = Pool.Ping(context.Background())
if err != nil {
log.Fatalf("Unable to ping the database: %v", err)
}
log.Println("Successfully connected to the database")
}