Here’s an email from a good friend of mine that may be of interest. It is done
in Ruby.
From: Brad Robel-Forrest [mailto:[email protected]]
Sent: Sunday, May 15, 2011 7:01 PM
To: Daevid Vincent
Subject: MySQL shell...with parameters
Remember a long while back I was bitching about the need for parameterized
MySQL when working at the prompt? Well, it took me down a road and I've
fulfilled that need and many more. If you're interested, I've opened a project
on a shell that allows you to write all manner of SQL queries with variable
interpolation and even generated query for programmatic searching through your
database. Plus, it has the ability to do all of this remotely over an SSH
connection without needing to have a mysql binary installed either locally or
remotely.
Main project site: https://github.com/bradrf/rsql
Installing on Windows: https://github.com/bradrf/rsql/wiki/Install-on-Windows
Tutorial: https://github.com/bradrf/rsql/raw/master/example.rsqlrc
I've been using it a ton for analyzing our database at work for the past
several months. It's a rare day that goes by where I don't fire this up.
-brad