Skip to content

Go package for testing code that uses PostgreSQL

License

Notifications You must be signed in to change notification settings

orsinium-labs/pgxtester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: "..."})
    // ...
}