Lab realized as a student at ECN. This app is a python CLI (command line interface) to query a PostgreSQL database. https://github.com/DricomDragon/PythonPostgresLab

Jovian (Netbook) d1ea937eed Refactoring titles and OS indication před 6 roky
SQL e6dee9186d SQL script to populate database with sample data před 6 roky
.gitignore bad4ff78b1 Initial commit před 6 roky
README.md d1ea937eed Refactoring titles and OS indication před 6 roky
app_dispatcher.py 2499e2a626 Connection to a local postgres sql database před 6 roky
connect.py 55589e50fa Fix the connection access in methods před 6 roky
test_pyinquirer.py 983c648b55 New script without sql to test pyinquirer před 6 roky

README.md

PythonPostgresLab

A CLI (Command Line Interface) written in python to query a PostgreSQL database. Lab realized as a student at Ecole Centrale de Nantes (ECN).

Prerequisites

What you need to get this project running. These commands were tested on a debian based system (Ubuntu 18.04 LTS).

Python packages

PyInquirer

For easy CLI python interfaces : sudo pip3 install pyinquirer

Postgres

To install PostgreSQL driver : sudo pip3 install postgres

PostgreSQL database

I strongly recommand to know how to run an instance of postgreSQL. The schema is a model of a logistics company.

Install a postgreSQL instance

Install postgreSQL : sudo apt install postgresql

Start service : sudo service postgresql start

Create the database

Connect with postgres profile : sudo su postgres

Create the database : psql -f SQL/create_db.sql postgres

Populate database with tables : psql -d logistics -f SQL/create_tables.sql postgres

Populate tables with sample data : psql -d logistics -f SQL/populate_tables.sql postgres

If needed you can adapt the password of postgres user (or any user you want) : psql -c "alter user postgres password 'postgres_password'"