Skip to content

Files

Latest commit

50b852c · Jun 15, 2016

History

History

postgres

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 29, 2016
May 19, 2016
May 24, 2016
May 19, 2016
May 24, 2016
Sep 13, 2015
Jun 7, 2016
May 31, 2016
Jun 13, 2016
Sep 13, 2015
May 24, 2016
May 8, 2016
May 19, 2016
Jun 15, 2016
Feb 28, 2016

PostGres

The PostGres dialect uses the github.com/lib/pq driver, which passes the compatibility test suite.

Testing

A valid PostGres connection string should be set on the environmental variable SOL_TEST_POSTGRES. An example:

SOL_TEST_POSTGRES="host=localhost port=5432 dbname=sol_test user=postgres password=secret sslmode=disable" go test

If the environmental variable is empty, the test will default to a Travis CI connection string, which will likely panic on your local system.

Docker

Docker hub provides an official PostGres image. A container can be started with:

docker run -p 5432:5432 --name postgres \
-e "POSTGRES_PASSWORD=" \
-e "POSTGRES_DB=sol_test" -d postgres:latest

Then change the host of the connection string to the default Docker machine and run tests, for example:

SOL_TEST_POSTGRES="host=<DOCKER HOST> port=5432 dbname=sol_test user=postgres sslmode=disable" go test