Skip to content

Generate database table description

Note

This guide works only for the postgres database running locally in a Docker container.

Short way (single command)

(Optional) Get all table names

This is helpful for getting a list of table names to use in the next command.

./scripts/db.sh -c "\dt"
  1. Get table description

    This command prints the table description to the terminal.

    ./scripts/db.sh -c "\d <table_name>"
    

    Example table name: core_user

    ./scripts/db.sh -c "\d core_user"
    

Long way (interactive)

  1. Enter the database shell in the docker container (\q to exit)

    ./scripts/db.sh
    
  2. Get list of tables

    \dt
    
  3. Get table description

    \d <table_name>
    

When to use this

  • It's useful to generate the latest table description in text format for verification after making updates to a table.

Who should use this

  • Developers