Skip to content

Commit

Permalink
Output Database Tables and Schema
Browse files Browse the repository at this point in the history
Output the database tables and schema for each table from the support
script to enhance troubleshooting.
  • Loading branch information
jekhokie committed Mar 23, 2021
1 parent f5e479c commit 58d8921
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GIT_CHANGES=$(git diff --name-only)
SDR_INFO=$(rtl_eeprom 2>&1)
RPI_MODEL=$(cat /proc/device-tree/model | tr -d '\0')
DISK_LAYOUT=$(lsblk)
DB_TABLES=$(sqlite3 db/panel.db "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%';")

echo "============================================="
echo "Details about environment"
Expand Down Expand Up @@ -94,3 +95,16 @@ fi
echo "---------------------------------------------"
echo "SDR Information:"
echo -e "${SDR_INFO}"

echo "---------------------------------------------"
echo "Database tables:"
if [ -z "${DB_TABLES}" ]; then
echo " (None)"
else
for db_table in $DB_TABLES; do
table_schema=$(sqlite3 db/panel.db ".schema ${db_table}")
echo " ${db_table} =>"
echo " ${table_schema}"
echo ""
done
fi

0 comments on commit 58d8921

Please sign in to comment.