sqlcmd is a Python-based SQL command line tool, similar in concept to tools like Oracle's SQL*Plus, the PostgreSQL psql command, and MySQL's mysql tool.
In short, sqlcmd is a SQL command tool that attempts to provide the same interface for all supported databases and across all platforms.
sqlcmd has been tested on the following platforms:
* Mac OS X, version 10.4 (Tiger), using MacPython
* Linux (Ubuntu, Gutsy and Hardy)
* Windows XP, using the non-Cygwin Windows version of Python and pyreadline
Here are some key features of "sqlcmd":
· Connection parameters for individual databases are kept in a configuration file in your home directory.
· Databases can be assigned multiple logical names.
· Command history management, with GNU Readline support. Each database has its own history file.
· Supports retrieving database metadata (getting a list of tables, querying the table's columns and their data types, listing the indexes and foreign keys for a table, etc.).
· Supports Unix shell-style variables.
· Standard interface that works the same no matter what database you're using.
· Uses the enhanced database drivers in the Grizzled API's db module. (Those drivers are, in turn, built on top of standard Python DB API drivers like psycopg2 and MySQLdb.)
· MySQL (tested with MySQL 5 on Linux, Mac OS X, and FreeBSD)
· Oracle (tested with Oracle Database 10g Express Edition for Linux)
· PostgreSQL (tested with versions 8.1 through 8.3 on Linux and Mac OS X)
· SQL Server (tested with SQL Server Express 2005, using pymssql)
· SQLite (tested on Linux and Mac OS X)
· You will have to install Python DB API drivers for all but SQLite.
· Written entirely in Python, which makes it very portable (though the database drivers are often written in C and may not be available on all platforms).