#!/mod/bin/jimsh
package require sqlite3
proc db_info {db_file} {
set db [sqlite3.open $db_file]
set tables [$db query {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name}]
puts "
$db_file
"
foreach table $tables {
set table_name [lindex $table 1]
set columns [$db query "pragma table_info($table_name)"]
set datas [$db query "SELECT * FROM $table_name"]
puts "$table_name
"
puts ""
puts " "
foreach column $columns {
puts " [lindex $column 3] | "
}
puts "
"
foreach data $datas {
puts " "
for {set i 1} {$i < [llength $data]} {incr i 2} {
puts " [lindex $data $i] | "
}
puts "
"
}
puts "
"
}
$db close
}
puts {}
db_info /var/lib/humaxtv/rsv.db
db_info /var/lib/humaxtv/setup.db
db_info /var/lib/humaxtv/channel.db