Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 663 Bytes

README.md

File metadata and controls

52 lines (35 loc) · 663 Bytes

SQL test

Prerequisistes

$ python3 -m pip install pipenv --user
  • Use virtualenv
$ PIPENV_VENV_IN_PROJECT=true pipenv shell
  • Install dependencies
$ pipenv install --dev

Usage

  • Run up Postgresql server
$ docker-compose up db
  • Stop Postgresql server
$ docker-compose down
  • Connect to test database on Postgresql server using psql
$ docker-compose exec db psql -U postgres test
  • Execute SQL file
$ docker-compose exec db psql -v ON_ERROR_STOP=1 -U postgres test -a -f "sql/schema.sql"
  • Testing using database
$ docker-compose up dbtest