Skip to content

Database Documentation (dbdocs)

This project uses dbdocs.io to host the schema documentation for the performance_db database. It provides an interactive interface to visualize tables, relationships, and column types.

🔗 Access the Documentation

The documentation is deployed privately. You can access it using the credentials below:

Note: The dbdocs project is linked to the team account performance@echoenergia.com.br.


⚙️ Automation Pipeline

The documentation is automatically updated daily via an Airflow DAG.

Architecture

The update process follows this flow:

  1. Airflow DAG (pg-update-dbdocs) triggers a task.
  2. SSH Operator connects to the echo-performance server (100.64.141.14).
  3. Bash Script (update_dbdocs.sh) is executed on the server.
  4. dbdocs CLI connects to Postgres, generates the DBML file, and uploads it to the cloud.

Source Files

  • Airflow DAG: dags/pg-update-dbdocs.py
  • Server Script: /home/performance/performance_project/dbdocs/update_dbdocs.sh

🛠 Manual Update

If you make schema changes and need to update the documentation immediately (without waiting for the daily schedule), you can trigger the update manually from the server.

  1. SSH into the server:

    ssh performance@100.64.141.14
    
  2. Run the update script:

    bash /home/performance/performance_project/dbdocs/update_dbdocs.sh
    

You should see the message: Documentation updated successfully!