Skip to content

Commit

Permalink
nodb
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Nov 23, 2023
1 parent 7eb08fb commit 05ac616
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package txdb_test

import (
"database/sql"
"net/url"
"testing"
)

Expand All @@ -25,7 +26,12 @@ const (

// bootstrap bootstraps the database with the nfor tests.
func bootstrap(t *testing.T, driver, dsn string) {
db, err := sql.Open(driver, dsn)
parsed, err := url.Parse(dsn)
if err != nil {
t.Fatalf("failed to parse dsn %q: %s", dsn, err)
}
parsed.Path = "" // Remove the database name from the DSN
db, err := sql.Open(driver, parsed.String())
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 05ac616

Please sign in to comment.