Connecting to Vagrant DB Locally

The Vagrant VM sets up PostgreSQL such that you can access it from within the VM as well as from outside it for ease of development. When you start Vagrant, it will map the port 5432 inside the VM to the port 16432 outside the VM. You can then connect by specifying localhost for the host and then submitty_${SEMESTER}_${COURSE} (replacing ${SEMESTER} and ${COURSE} with the actual one you want) for the DB to connect to. The user and password are both submitty_dbuser. All tables are then located in the public schema.

We recommed that to connect to the DB that you use one of the following options ranging from simplest to most powerful.

  1. psql (CLI for connecting to PostgreSQL)

  2. pgAdmin (GUI for connecting to PostgreSQL)

  3. navicat (GUI for managing PostgreSQL)

  4. DataGrip (“Database IDE”, can connect to most DB types)

Note: When adding a new server to pgAdmin, change the following parameters in the server’s Connection settings:

You do not need to change the port or the maintenance database - the port should say 5432 and the maintenance database should say postgres by default.

Entity-Relation Diagrams

  1. Submitty Database (updated 2019-06-05, see code for most recent): Database Entity Graph

  2. Courses Tables (updated 2019-06-05, see code for most recent): Database Entity Graph

Diagram generated using DataGrip, by connecting to the DB, right-clicking on public schema, Diagrams > Show Visualization…