You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Nathan Bergey b4b82b0f74 Practice 3 using the provided json as-is 2 weeks ago
docs Practice 3 using the provided json as-is 2 weeks ago
env misc: Use python and test with docker 3 years ago
sql misc: Add SQL practices 3 years ago
test Practice 3 using the provided json as-is 2 weeks ago
.gitignore misc: Use python and test with docker 3 years ago
Pipfile misc: Upgrade python & postgres version 2 years ago
Pipfile.lock build(deps): bump py from 1.9.0 to 1.10.0 1 year ago
README.md Test 1: Simple join with a count and group 2 weeks ago
docker-compose.yml misc: Upgrade python & postgres version 2 years ago

README.md

SQL test

Nathan's SQL answers. Tests past in test/test_example.py

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