Skip to content

Latest commit

 

History

History

homework4_database

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Basketball Statistics - Database Programming

System Requirements

Ubuntu 18.04/20.04 with Python3.8+

Warning: autograder is configured with AWS EC2 running Ubuntu 18.04 AMI, using prepared statements (e.g. pqxx::worker::exec_prepared()) may cause compilation error

Development Setup

Local PostgreSQL

  1. update system, install postgres dev tools and C++ API
sudo apt install postgresql postgresql-contrib libpqxx-dev
  1. start postgres service
sudo service postgresql start
  1. connect to postgres server and set up password
sudo su - postgres
psql
ALTER USER postgres with encrypted password 'passw0rd';
\q
exit
  1. edit pg_bha.conf to allow localhost password authentication, by replacing local all postgres peer with local all postgres md5
sudo nano /etc/postgresql/12/main/pg_hba.conf
  1. restart postgres
sudo service postgresql restart
  1. start postgres shell and create database
psql -U postgres
CREATE DATABASE "ACC_BBALL";
  1. verify database creation and exit
\l
exit

Python

  1. go to orm/ and create a Python virtual environment
cd orm
python3 -m venv venv
  1. activate the virtual environment and download dependencies
source venv/bin/activate
pip install -r requirements.txt
  1. (optional) deactivate virtual environment on exit
deactivate