A Naïve SQL Shell

For one client, I was told that our devs didn't have client access to a database with a problem, but they could connect via DBI. Thus, I whipped up the following to help them out.

It has command line history and mostly handles multi-line queries. It's not overly robust, but it's the sort of handy code you might just need in a pinch.


If you can install modules, DBI::Shell and you’re done.

Second on DBI::Shell, since sqlplus is terrible, but this is also why I wrote the ysql utility of Yertl

I'd like to recommend https://metacpan.org/pod/Text::TabularDisplay over Text::Table.

To the two people who recommended DBI::Shell... are you serious?

In two days it will be exactly 8 years since the last release. A perusal of the failed tests shows code rot is setting in.

DBI::Shell is abandoned. Use at your own peril.

Leave a comment

About Ovid

user-pic Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/