changes in app and pgx

This commit is contained in:
Pedro Pérez 2025-03-27 06:01:02 +01:00
parent 08a5e7fec6
commit b9356ae0e1
2 changed files with 10 additions and 5 deletions

View File

@ -47,8 +47,9 @@ const (
InvalidEntityID string = "invalid_entity_id" InvalidEntityID string = "invalid_entity_id"
NotImplemented string = "not_implemented" NotImplemented string = "not_implemented"
NotPassValidation string = "not_pass_validation" NotPassValidation string = "not_pass_validation"
NotEnoughBalance string = "not_enough_balance"
// User keys // User keys (DB)
UserUsernameKey string = "username_key" UserUsernameKey string = "username_key"
UserEmailKey string = "email_key" UserEmailKey string = "email_key"
UsernameAlreadyExists string = "username_already_exists" UsernameAlreadyExists string = "username_already_exists"
@ -56,9 +57,12 @@ const (
EmailAlreadyExists string = "email_already_exists" EmailAlreadyExists string = "email_already_exists"
PhoneNumberKey string = "phone_number_key" PhoneNumberKey string = "phone_number_key"
PhoneAlreadyExists string = "phone_already_exists" PhoneAlreadyExists string = "phone_already_exists"
IncorrectPassword string = "incorrect_password"
ErrorGeneratingToken string = "error_generating_token" // Auth
LoggedIn string = "logged_in" TokenPayload string = "token_payload"
LoggedIn string = "logged_in"
IncorrectPassword string = "incorrect_password"
ErrorGeneratingToken string = "error_generating_token"
) )
var ( var (

View File

@ -2,11 +2,12 @@ package db
import ( import (
"context" "context"
"log/slog"
_ "github.com/jackc/pgconn" _ "github.com/jackc/pgconn"
_ "github.com/jackc/pgx/v5" _ "github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool" "github.com/jackc/pgx/v5/pgxpool"
_ "github.com/jackc/pgx/v5/stdlib" _ "github.com/jackc/pgx/v5/stdlib"
"log/slog"
) )
func NewPGXPool(dataSource string) *pgxpool.Pool { func NewPGXPool(dataSource string) *pgxpool.Pool {