Rewritten in go and python

This commit is contained in:
2024-11-06 01:25:27 +04:00
parent 9f22d9678d
commit d8449237bb
50 changed files with 3824 additions and 879 deletions

View File

@@ -0,0 +1,16 @@
package postgresql
import (
"context"
"fmt"
"github.com/jackc/pgx/v5"
)
func NewDB(dbURL string) (*pgx.Conn, error) {
conn, err := pgx.Connect(context.Background(), dbURL)
if err != nil {
return nil, fmt.Errorf("failed to connect to database: %w", err)
}
return conn, nil
}