Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultURL ¶
func GetDefaultURL() string
SetDefaultURL returns the default URL used to connect to the postgres server while creating and destorying test databases.
func GetEnvName ¶
func GetEnvName() string
GetEnvName gets the enviroment variable name used to fetch the pgxpool URL, defaults name is PGURL.
func GetURL ¶
func GetURL() string
GetURL returns the pgx pool URL from environment or the default value.
func SetDefaultURL ¶
func SetDefaultURL(pgxurl string)
SetDefaultURL sets the default URL for postgres tests, panics if the url is invalid
func SetEnvName ¶
func SetEnvName(name string)
SetEnvName sets the enviroment variable name used to fetch the pgxpool URL, defaults name is PGURL.
Types ¶
type PoolURL ¶
type PoolURL string
PoolURL makes for quick manipulation of some paramets that are important for tests. The url is expected to always be a valid URL, utility functions will panic if it's not.
func NewPoolURL ¶
NewPoolURL validates the input yurl
func (PoolURL) ConnURL ¶
ConnURL returns a valid non pool connection url (can be used with go-migrate or sql.db)