mirror of
https://github.com/heroiclabs/sql-migrate.git
synced 2026-11-13 20:12:40 -10:00
23 lines
402 B
Go
23 lines
402 B
Go
package migrate
|
|
|
|
import (
|
|
"context"
|
|
"github.com/jackc/pgx/v5"
|
|
"net/url"
|
|
"testing"
|
|
|
|
. "gopkg.in/check.v1"
|
|
)
|
|
|
|
func Test(t *testing.T) { TestingT(t) }
|
|
|
|
func pgxConnect() (*pgx.Conn, error) {
|
|
rawURL := "postgres://postgres:[email protected]:5432/migrate-test"
|
|
parsedURL, err := url.Parse(rawURL)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return pgx.Connect(context.Background(), parsedURL.String())
|
|
}
|