a db2 console with with history and autocomplete support
Ruby
Latest commit 1bd287c Feb 2, 2012 @onsitedev onsitedev Update README
Failed to load latest commit information.
bin
lib
man
rlwrap/filters
spec/db2c
.gitignore
Gemfile
LICENSE
README.md
Rakefile
db2c.gemspec

README.md

DB2 console with history, autocomplete support and few other goodies

DB2 console mode does not support readline and autocomplete, this is a wrapper for the db2 command mode that adds support for both. It also tries to make using db2 a little bit more tolerable, adding support for interactive editing and psql-like meta commands and other shortcuts.

Install

apt-get install rlwrap
gem install db2c

Examples

db2 => use testdb
db2(testdb) => current date
db2(testdb) => -107
db2(testdb) => history
db2(testdb) => select * from table.with.many.columns | less -S
db2(testdb) => edit
db2(testdb) => ls ~
db2(testdb) => irb
db2(testdb) => \l
db2(testdb) => \lt schema
db2(testdb) => \dv | grep -v SYS
db2(testdb) => \d schema.table
db2(testdb) => help

Acknowledgement

  • Chris Jester-Young (CKY) found out the problem of using shell metacharacters when executing commands from Ruby.
  • The initial script was inspired by defunkt's repl, for a genenral purpose repl/wrapper, this is your friend.
  • Ben Ellis (benissimo) did all the beta testing

See