send all files

This commit is contained in:
2024-07-21 00:15:14 -03:00
parent 1e8cda0139
commit c9464c4a6f
72 changed files with 6335 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package postgres
import (
"api/helpers/variable"
"api/libs/logger"
"context"
"os"
"github.com/jackc/pgx/v5/pgxpool"
)
var Pool *pgxpool.Pool
func InitializeDatabaseConnection() {
poolConfig, err := pgxpool.ParseConfig(variable.GetEnvVariable("DATABASE_URL"))
Pool, err = pgxpool.NewWithConfig(context.Background(), poolConfig)
if err != nil {
logger.Development.Info(err.Error())
os.Exit(1)
}
logger.Development.Info("Connected to Postgres database")
}