Start adding tests
Some checks failed
ci/woodpecker/push/build Pipeline failed

Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
This commit is contained in:
2026-05-17 16:14:59 +02:00
parent 9e8ddd9433
commit 60297dfaf7
9 changed files with 180 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
package postgres
import (
"context"
"github.com/jackc/pgx/v5/pgxpool"
_ "github.com/jackc/pgx/v5/stdlib"
)
func Open(ctx context.Context, dsn string) (*pgxpool.Pool, error) {
dbpool, err := pgxpool.New(context.Background(), dsn)
if err != nil {
return nil, err
}
if err := dbpool.Ping(ctx); err != nil {
return nil, err
}
return dbpool, nil
}