Implement first db-test using go-txdb

This commit is contained in:
2022-02-09 22:25:51 +00:00
parent c3db535e10
commit 6ab8a96888
4 changed files with 60 additions and 29 deletions

View File

@ -18,8 +18,8 @@ type Database struct {
}
// Connect to a database
func Connect(connString string) (*Database, error) {
conn, err := sql.Open("pgx", connString)
func Connect(typ string, connString string) (*Database, error) {
conn, err := sql.Open(typ, connString)
if err != nil {
return nil, fmt.Errorf("open connection: %w", err)
}