#!/usr/local/bin/tclsh8.6

package require sqlite3

if {$argc!=2} {
  puts stderr "Usage: $argv0 DATABASE SQL-STATEMENT"
  exit 1
}
sqlite3 db [lindex $argv 0]
db eval [lindex $argv 1] x {
  foreach v $x(*) {
    puts "$v = $x($v)"
  }
  puts ""
}
db close
