Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 500 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 500 Bytes

pgxtester

A Go package for testing code that uses PostgreSQL. It establishes a concurrency-safe pgx connection, wraps it into a transaction, and rolls back the transaction at the end of the test. This ensures that changes done in a test will not affect other tests.

Installation

go get github.com/orsinium-labs/pgxtester

Usage

func SomeTest(t *testing.T) {
    conn := pgxtester.Connect(t, pgxtester.Config{URL: "..."})
    // ...
}