Has anyone seen or developed a class for producing tables on the
console, a la pgsql, mysql data display?
culley
Has anyone seen or developed a class for producing tables on the
console, a la pgsql, mysql data display?
culley
Culley harrelson wrote:
Has anyone seen or developed a class for producing tables on the
console, a la pgsql, mysql data display?culley
ncurses may be a bit overkill for just a few tables… but there is an
ncurses library for ruby: http://ncurses-ruby.berlios.de/
–
dc -e
4ddod3dddn1-89danrn10-dan3+ann6dan2an13dn1+dn2-dn3+5ddan2/9+an13nap
Have a look at DBI::Utils::TableFormatter in the ruby-dbi-all package.
Example of its use in sqlsh.rb :
stmt = $dbconn.prepare(line)
head = stmt.column_names
next if head.empty?
rows = stmt.fetch_all
DBI::Utils::TableFormatter.ascii(head, rows)
Regards,
Brian.
On Sat, May 31, 2003 at 05:39:49PM +0900, Culley harrelson wrote:
Has anyone seen or developed a class for producing tables on the
console, a la pgsql, mysql data display?