Debugging - when working with Databases

Having trouble debugging your code? Can't see the data that's supposed to be there? Here is a list of things you probably want to check first:

Given that you are working in a Docker/cloud environment:

  1. Dockerfile

  2. Docker-compose file

    1. variable names

    2. container names

    3. endpoints

  3. Docker containers

    1. variable values

    2. logs

  4. Database

    1. DB status: is your DB running?

    2. data status: is your data there? Are they seeded correctly?

    3. data referencing:

      1. Are the values updated?

        • If your code needs to fetch data using sql statements that refer to multiple attributes, check if:

          • all the attribute names are correct

          • all the values referred to are correct AND up-to-date (some values might be regularly updated or changed) - for example, your gitpod workspace' IP address.

  5. Your code

    1. Typo, misspellings

    2. return is actually returning something

    3. Datatype

      1. When your codes pass around data, see if:

        1. Input & Output data have the expected data structures

        2. Data returned by return statement has the expected data structure