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.
 
 
rkaneko 1ed6ba9c56 misc: Add SQL practices 5 years ago
docs misc: Add SQL practices 5 years ago
env misc: Use python and test with docker 5 years ago
sql misc: Add SQL practices 5 years ago
test misc: Add SQL practices 5 years ago
.gitignore misc: Use python and test with docker 5 years ago
Pipfile misc: Use python and test with docker 5 years ago
Pipfile.lock misc: Use python and test with docker 5 years ago
README.md misc: Use python and test with docker 5 years ago
docker-compose.yml misc: Add SQL practices 5 years ago

README.md

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