<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
    <added>
      <filename>MANIFEST.in</filename>
    </added>
    <added>
      <filename>README</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -100,3 +100,8 @@ div.highlight pre span.s
 {
     color: green;
 }
+
+ul.simple li
+{
+    list-style: disc;
+}</diff>
      <filename>doc/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -27,22 +27,31 @@ Introduction
 Some features at a glance
 --------------------------
 
-- Connection parameters for individual databases are kept in a ``.sqlcmd``
+- Connection parameters for individual databases are kept in a configuration
   file in your home directory.
 - Databases can be assigned multiple logical names.
-- GNU Readline support, with history management. History files are saved
-  per database.
-- Ability to get a list of tables, examine a table's columns, and get a list of
-  the indexes and foreign keys for a table.
-- A ``.set`` command that displays and controls *sqlcmd* settings.
-- Uses the enhanced database drivers in the `Grizzled API`_'s ``db``
+- *sqlcmd* has command history management, with `GNU Readline`_ support.
+  History files are saved per database.
+- *sqlcmd* supports SQL, but also supports 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.).
+- *sqlcmd* command has a ``.set`` command that displays and controls *sqlcmd* 
+  settings.
+- *sqlcmd* provides a standard interface that works the same no matter what 
+  database you're using.
+- *sqlcmd* 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``.)
+- *sqlcmd* is 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).
 
-  .. _Grizzled API: http://www.clapper.org/software/python/grizzled/
+.. _Grizzled API: http://www.clapper.org/software/python/grizzled/
+.. _GNU Readline: http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html
+.. _Python: http://www.python.org/
 
 In short, *sqlcmd* is a SQL command tool that attempts to provide the same
-interface for all supported databases.
+interface for all supported databases and across all platforms.
 
 Usage
 =====
@@ -96,7 +105,7 @@ Parameters
   run once *sqlcmd* has connected to the database. If this parameter is omitted,
   *sqlcmd* will enter command line mode, prompting on standard input for each
   command.
-  
+
 Specifying a Database
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -105,24 +114,24 @@ comma-separated parameters, in order:
 
 ``dbname``:
     The name of the database. (For SQLite, this is the path to the file.)
-    
+
 ``dbtype``:
     The database type, as defined by the `Grizzled Utility Library`_'s `db`_
     package, ``oracle``,``sqlserver``, ``mysql``, ``postgresql`` and
-    ``sqlite``. Additional database types can be added, however; see 
+    ``sqlite``. Additional database types can be added, however; see
     below_.
-    
+
 .. _below: `Configuration File`_
 
 ``host:port``:
-    The host name and port number on which the database server is listening for 
+    The host name and port number on which the database server is listening for
     connections. This field is ignored, and may be empty, for SQLite. The port
     number may be omitted (i.e., with only the host name specified), and the
     database driver will use the default port for the database type.
-    
+
 ``user``:
     The user to use when authenticating to the database. Ignored for SQLite.
-    
+
 ``password``:
     The password to use when authenticating to the database. Ignored for SQLite.
 
@@ -132,12 +141,12 @@ Examples:
 Connect to a SQLite database residing in file ``/tmp/test.db``::
 
     sqlcmd -d /tmp/test.db,sqlite,,,
-    
+
 Connect to an Oracle database named &quot;customers&quot; on host ``db.example.com``,
 using user &quot;scott&quot; and password &quot;tiger&quot;::
 
     sqlcmd -d customers,oracle,db.example.com,scott,tiger
-    
+
 Connect to a PostgreSQL database named &quot;mydb&quot; on the current host, using user
 &quot;psql&quot; and password &quot;foo.bar&quot;::
 
@@ -183,19 +192,23 @@ The following file specifies the same databases as in the examples, above:
     user=psql
     password=foo.bar
 
-Now, if you store that file in ``$HOME/.sqlcmd/config`` (the default place 
-*sqlcmd* searches for it), connecting to each of the databases is much simpler::
+Now, if you store that file in ``$HOME/.sqlcmd/config`` (the default place
+*sqlcmd* searches for it), connecting to each of the databases is much simpler:
+
+.. code-block:: bash
+
+    $ sqlcmd testdb
+    $ sqlcmd customers
+    $ sqlcmd mydb
 
-    sqlcmd testdb
-    sqlcmd customers
-    sqlcmd mydb
-    
 You can store the file somewhere else, of course; you just have to tell
-*sqlcmd* where it is::
+*sqlcmd* where it is:
+
+.. code-block:: bash
 
-    sqlcmd -c /usr/local/etc/sqlcmd.cfg testdb
-    sqlcmd -c /usr/local/etc/sqlcmd.cfg customers
-    sqlcmd -c /usr/local/etc/sqlcmd.cfg mydb
+    $ sqlcmd -c /usr/local/etc/sqlcmd.cfg testdb
+    $ sqlcmd -c /usr/local/etc/sqlcmd.cfg customers
+    $ sqlcmd -c /usr/local/etc/sqlcmd.cfg mydb
 
 See the next section for details on the specific sections and options in the
 *sqlcmd* configuration file.
@@ -203,15 +216,223 @@ See the next section for details on the specific sections and options in the
 Configuration File in Depth
 ---------------------------
 
+A *sqlcmd* configuration file, typically stored in ``$HOME/.sqlcmd/config``,
+is an INI-style file divided into logical sections. Each of those sections
+is described below. All section names must be unique within the file.
+
+Blank lines and comment lines are ignored; comment lines start with a &quot;#&quot;
+character.
+
+*sqlcmd* uses the `Grizzled API`_'s `grizzled.config.Configuration`_
+class to parse the file; that class is, in turn, an enhancement of the standard
+Python `ConfigParser`_ class.
+
+.. _grizzled.config.Configuration: http://www.clapper.org/software/python/grizzled/epydoc/grizzled.config.Configuration-class.html
+.. _ConfigParser: http://docs.python.org/lib/module-ConfigParser.html
+
+Because *sqlcmd* uses the Grizzled API's ``Configuration`` class, you can use
+include directives and variable substitution in the configuration file, if
+you with. See the `grizzled.config.Configuration`_ documentation for more
+details.
+
 The ``db.`` Sections
 ~~~~~~~~~~~~~~~~~~~~
 
+A ``db.`` section contains the connection definition for a particular database.
+The ``db.`` prefix must be followed by the primary name of the database.
+Multiple ``db.`` sections can exist in the configuration file; each section
+supports the following parameters.
+
+    +------------------+---------------------------------+---------------------+
+    | *Parameter Name* | *Description*                   | *Required/Optional* |
+    +==================+=================================+=====================+
+    + ``database``     | The name of the database, as    | required            |
+    |                  | known by the RDBMS engine.      |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``type``         | The type of the database. This  | required            |
+    |                  | value must be recognized by the |                     |
+    |                  | Grizzled API's ``db`` module.   |                     |
+    |                  | That means it must identify a   |                     |
+    |                  | database driver that is part of |                     |
+    |                  | the ``grizzled.db`` package, or |                     |
+    |                  | it must be a driver you specify |                     |
+    |                  | yourself, in a ``driver.``      |                     |
+    |                  | section. (See `below`_.)        |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``host``         | The host on which the database  | required (but       |
+    |                  | resides. The RDBMS server on    | ignored for SQLite) |
+    |                  | that host must be configured to |                     |
+    |                  | accept incoming database client |                     |
+    |                  | connections.                    |                     |
+    |                  |                                 |                     |
+    |                  | This parameter is ignored for   |                     |
+    |                  | SQLite databases.               |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``port``         | The port on which the database  | optional (but       |
+    |                  | server is listening. If not     | ignored for SQLite) |
+    |                  | specified, *sqlcmd* uses the    |                     |
+    |                  | default port for the RDBMS      |                     |
+    |                  | server (e.g, 1521 for Oracle,   |                     |
+    |                  | 1433 for SQL Server, 3306 for   |                     |
+    |                  | MYSQL, 5432 for PostgreSQL,     |                     |
+    |                  | etc.).                          |                     |
+    |                  |                                 |                     |
+    |                  | This parameter is ignored for   |                     |
+    |                  | SQLite databases.               |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``user``         | The user to use when            | required (but       |
+    |                  | authenticating to the database. | ignored for SQLite) |
+    |                  |                                 |                     |
+    |                  | This parameter is ignored for   |                     |
+    |                  | SQLite databases.               |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``password``     | The password to use when        | required (but       |
+    |                  | authenticating to the database. | ignored for SQLite) |
+    |                  |                                 |                     |
+    |                  | This parameter is ignored for   |                     |
+    |                  | SQLite databases.               |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``aliases``      | A comma-separated list of alias | optional            |
+    |                  | names for the database. This    |                     |
+    |                  | list allows you to refer to the |                     |
+    |                  | database by multiple names      |                     |
+    +------------------+---------------------------------+---------------------+
+
+A Note about Database Names
++++++++++++++++++++++++++++
+
+When you specify the name of a database on the *sqlcmd* command line,
+*sqlcmd* attempts to match that name against the names of all databases in
+the configuration file. *sqlcmd* compares the name you specify against the
+following values from each ``db.`` configuration section:
+
+- The section name, minus the ``db.`` prefix. This is the primary name of
+  the database, from *sqlcmd*'s perspective.
+- The value of the ``database`` option.
+- The value or values of the ``aliases`` option.
+
+You only need to specify as many characters as are
+necessary to uniquely identify the database.
+
+Thus, given this configuration file:
+
+.. code-block:: ini
+
+
+    [db.testdb]
+    names=sqlite, test
+    database=/tmp/test.db
+    type=sqlite
+
+    [db.customers]
+    names=oracle, custdb
+    database=cust001
+    type=oracle
+    host=db.example.com
+    user=scott
+    password=tiger
+
+
+You can connect to the ``customers`` database using any of the following
+names:
+
+- ``customers``: the section name, minus ``db.``.
+- ``custdb``: one of the aliases
+- ``oracle``: the other alias
+- ``cust001``: the actual database name, from the ``database`` option
+- ``cust``: a unique abbreviation of ``customers`` or ``cust001``
+
+    
 The ``driver.`` Sections
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
+The ``driver.`` section allows you to install additional enhanced database
+drivers, beyond those that are built into the `Grizzled API`_'s ``db``
+package.
+
+An enhanced driver must extend the ``grizzled.db.DBDriver`` class and provide
+the appropriate methods. See the `appropriate Grizzled documentation`_ for
+details. If you want to write your own driver, the Grizzled source code is
+invaluable.
+
+.. _appropriate Grizzled documentation: http://www.clapper.org/software/python/grizzled/epydoc/grizzled.db-module.html
+
+The ``driver.`` section supports the following options:
+
+    +------------------+---------------------------------+---------------------+
+    | *Parameter Name* | *Description*                   | *Required/Optional* |
+    +==================+=================================+=====================+
+    + ``class``        | The fully-qualified name of the | required            |
+    |                  | driver class, including any     |                     |
+    |                  | package and/or module name.     |                     |
+    +------------------+---------------------------------+---------------------+
+    | ``name``         | The logical name to use for the | required            |
+    |                  | driver.                         |                     |
+    +------------------+---------------------------------+---------------------+
+
+For example, suppose you wrote a driver to connect to the `Apache Derby`_
+database (perhaps using `JPype`_). Let's further suppose that the driver is
+implemented by a Python class called ``DerbyDriver`` (which extends the
+Grizzled ``DBDriver`` class) and resides in module ``mycode.db``. You could
+use the following *sqlcmd* configuration section to make *sqlcmd* aware of
+that driver:
+
+.. code-block:: ini
+
+    [driver.derby]
+    class=mycode.db.DerbyDriver
+    name=derby
+    
+With that section in the configuration file, you can now use the value ``derby``
+for the ``type`` parameter in any ``db.`` section.
+
+Obviously, the appropriate supporting Python (and other) code must be available
+to *sqlcmd*, by setting ``PYTHONPATH``, ``LD_LIBRARY_PATH``, and/or ``PATH``,
+as appropriate for your operating system.
+
+.. _Apache Derby: http://db.apache.org/derby/
+.. _JPype: http://jpype.sourceforge.net/
+
+
 Other Sections
 ~~~~~~~~~~~~~~
 
+*sqlcmd* quietly ignores any other sections in the configuration file. One
+possible use for other sections is as holders for common variable definitions
+that are substituted in other places in the file. For instance, suppose all
+your database engine happen to be on the same host and happen to use the same
+user name and password. To share that common configuration information, you
+might do something like the following:
+
+.. code-block:: ini
+
+    [defs]
+    # Shared definitions
+    dbhost=db.example.com
+    admin_user=admin
+    admin_password=foo.bar
+
+    [db.testdb]
+    names=sqlite, test
+    database=/tmp/test.db
+    type=sqlite
+
+    [db.customers]
+    names=oracle
+    database=customers
+    type=oracle
+    host=${dbhost}
+    user=${admin_user}
+    password=${admin_password}
+
+    [db.mydb]
+    names=postgres
+    database=mydb
+    type=postgresql
+    host=${dbhost}
+    user=${admin_user}
+    password=${admin_password}
+
 
 The *sqlcmd* Command Line Interface
 ===================================
@@ -240,19 +461,12 @@ transcript, to whet your whistle::
     Using readline for history management.
     Loading history file &quot;/home/bmc/.sqlcmd/mydb.hist&quot;
     ? .set
-
-    .set
-
     autocommit = true
     binarymax  = 20
-    echo       = true
+    echo       = false
     showbinary = false
     stacktrace = false
     timings    = true
-    ? .set echo false
-
-    .set echo false
-
     ? .show tables;
     users
     customers
@@ -275,11 +489,12 @@ transcript, to whet your whistle::
     Execution time: 0.092 seconds
     2 rows
 
-    id companyid lastname firstname middleinitial username email          
+    id companyid lastname firstname middleinitial username email
     -- --------- -------- --------- ------------- -------- ---------------
      1         1 Clapper  Brian     M             bmc      bmc@clapper.org
      2         1 User     Joe       NULL          joe      joe@example.org
 
+
 SQL
 ---
 
@@ -294,83 +509,99 @@ It does **not** wrap its output, however.
 Timings
 ~~~~~~~
 
-By default, *sqlcmd* times how long it takes to execute a SQL statement 
+By default, *sqlcmd* times how long it takes to execute a SQL statement
 and prints the resulting times on the screen. To suppress this behavior,
+set the ``timings`` variable to ``false``::
+
+    .set timings false
 
 
 SQL Echo
 ~~~~~~~~
 
+By default, *sqlcmd* does *not* echo commands to the screen. That's a
+reasonable behavior when you're using *sqlcmd* interactively. However, when
+you're loading a file full of *sqlcmd* statements, you might want each
+statement to be echoed before it is run. To enable command echo, set the
+``echo`` variable to ``true``::
+
+    .set echo true
+    
+Comments
+~~~~~~~~
+
+*sqlcmd* honors (and ignores) SQL comments, as long as each comment is on a
+line by itself. A SQL comment begins with &quot;--&quot;.
+
+Example of support syntax::
+
+    -- This is a SQL comment.
+    -- And so is this.
+    
+Example of *unsupported* syntax:
+
+.. code-block:: sql
+
+    INSERT INTO foo VALUES (1); -- initialize foo
+
 *sqlcmd*-specific Commands
 --------------------------
 
 These internal *sqlcmd* commands are one-line commands that do not require
-a trailing semi-colon and cannot be on multiple lines.
+a trailing semi-colon and cannot be on multiple lines. Most (but not all)
+of these commands start with a dot (&quot;.&quot;) character, to distinguish them
+from commands that are processed by the connected database engine.
 
-``.set.``
+``begin``
 ~~~~~~~~~
 
-The ``.set`` command displays or alters internal *sqlcmd* variables. Without
-any parameters, ``.set`` displays all internal variables and their values::
+Start a new transaction. This command is not permitted unless ``autocommit``
+is ``true``. (See `.set`_) ``begin`` is essentially a no-op: It's ignored in
+autocommit mode, and irrelevant when autocommit mode is off. It's there
+primarily for SQL scripts.
 
-    ? .set
+Example of use:
 
-    .set
+.. code-block:: sql
 
-    autocommit = true
-    binarymax  = 20
-    echo       = true
-    showbinary = false
-    stacktrace = false
-    timings    = true
+    begin
+    update foo set bar = 1;
+    commit
+    
+For compatibility with SQL scripts, this command does not begin with a &quot;.&quot;.
 
+See also:
 
-The supported variables are:
+- `.set`_
+- `commit`_
+- `rollback`_
 
-    +----------------+---------------------------------------------------------+
-    | *Variable*     | *Meaning*                                               |
-    +================+=========================================================+
-    | ``autocommit`` | Whether or not each SQL statement automatically commits |
-    |                | commits to the database. If ``true``, then each SQL     |
-    |                | statement is automatically committed to the database.   |
-    |                | If ``false``, then a new set of SQL statements starts a |
-    |                | transaction, which must be explicitly committed via the |
-    |                | ``commit`` command. Also, if ``autocommit`` is ``false``|
-    |                | the ``rollback`` command is enabled.                    |
-    |                |                                                         |
-    |                | Default: ``true``                                       |
-    +----------------+---------------------------------------------------------+
-    | ``binarymax``  | How many bytes to display from binary (BLOB and CLOB)   |
-    |                | columns. Ignored unless ``showbinary`` is ``true``.     |
-    |                |                                                         |
-    |                | Default: 20                                             |
-    +----------------+---------------------------------------------------------+
-    | ``echo``       | Whether or not commands are echoed before they are      |
-    |                | executed.                                               |
-    |                |                                                         |
-    |                | Default: ``true``                                       |
-    +----------------+---------------------------------------------------------+
-    | ``showbinary`` | Whether or not to show data from binary (CLOB or BLOB)  |
-    |                | columns. If ``true``, the value of ``binarymax``        |
-    |                | dictates how many bytes to display.                     |
-    |                |                                                         |
-    |                | Default: ``false``                                      |
-    +----------------+---------------------------------------------------------+
-    | ``stacktrace`` | Whether to display a Python stack trace on normal       |
-    |                | (i.e., expected) errors, like SQL syntax errors.        |
-    |                |                                                         |
-    |                | Default: ``false``                                      |
-    +----------------+---------------------------------------------------------+
-    | ``timings``    | Whether to display execution times for SQL statements.  |
-    |                |                                                         |
-    |                | Default: ``true``                                       |
-    +----------------+---------------------------------------------------------+
+``commit``
+~~~~~~~~~~
 
-``.show``
-~~~~~~~~~
+Commit the current transaction. Ignored if ``autocommit`` is enabled. For
+compatibility with SQL scripts, this command does not begin with a &quot;.&quot;.
+
+See also:
+
+- `.set`_
+- `begin`_
+- `rollback`_
+
+
+``.connect``
+~~~~~~~~~~~~
+
+The ``.connect`` command closes the current database connection and opens
+a new one to a (possibly) different database. The general form of the command
+is::
+
+    .connect dbname
+
+*dbname* is a database name from the configuration file. When it first starts
+running, *sqlcmd* issues an implicit ``.connect`` to the database specified
+on the command line.
 
-The ``.show`` command currently only supports one parameter: ``tables``.
-It's used to display the names of all tables in the database.
 
 ``.describe``
 ~~~~~~~~~~~~~
@@ -379,8 +610,8 @@ The ``.describe`` command, which can be abbreviated ``.desc``, is used to
 describe a table. The general form of the command is::
 
     .describe tablename [full]
-    
-If &quot;full&quot; is not specified, then *sqlcmd* prints a simple description of the 
+
+If &quot;full&quot; is not specified, then *sqlcmd* prints a simple description of the
 table and its columns. For instance::
 
     ? .desc users
@@ -428,3 +659,166 @@ the table's indexes. For example::
     etuserak1 Columns:     (companyid, username)
               Description: Unique, non-clustered btree index
 
+
+``.history``
+~~~~~~~~~~~~
+
+``.history`` displays the command history. See `Command History`_ for a
+complete explanation of *sqlcmd*'s command history capabilities.
+
+``.load``
+~~~~~~~~~
+
+Loads an external file of commands (typically SQL) and runs those commands in
+the current session *without exiting*. After the commands are run, *sqlcmd*
+returns to its interactive prompt. ``.load`` can be invoked in several ways::
+
+    .load path
+    @ path
+    @path
+    
+All three commands do exactly the same thing.
+
+``rollback``
+~~~~~~~~~~~~
+
+Roll the current transaction back. Ignored if ``autocommit`` is enabled. For
+compatibility with SQL scripts, this command does not begin with a &quot;.&quot;.
+
+See also:
+
+- `.set`_
+- `begin`_
+- `commit`_
+
+
+``.set``
+~~~~~~~~~
+
+The ``.set`` command displays or alters internal *sqlcmd* variables. Without
+any parameters, ``.set`` displays all internal variables and their values::
+
+    ? .set
+    autocommit = true
+    binarymax  = 20
+    echo       = true
+    showbinary = false
+    stacktrace = false
+    timings    = true
+
+
+The supported variables are:
+
+    +----------------+---------------------------------------------+----------+
+    | *Variable*     | *Meaning*                                   | Default  |
+    +================+=============================================+==========+
+    | ``autocommit`` | Whether or not each SQL statement           | ``true`` |
+    |                | automatically commits to the database. If   |          |
+    |                | ``true``, then each SQL statement is        |          |
+    |                | automatically committed to the database. If |          |
+    |                | ``false``, then a new set of SQL statements |          |
+    |                | starts a transaction, which must be         |          |
+    |                | explicitly committed via the ``commit``     |          |
+    |                | command. Also, if ``autocommit`` is         |          |
+    |                | ``false``, the ``rollback`` command is      |          |
+    |                | enabled.                                    |          |
+    +----------------+---------------------------------------------+----------+
+    | ``binarymax``  | How many bytes to display from binary (BLOB | 20       |
+    |                | and CLOB) columns. Ignored unless           |          |
+    |                | ``showbinary`` is ``true``.                 |          |
+    +----------------+---------------------------------------------+----------+
+    | ``echo``       | Whether or not commands are echoed before   | ``false``|
+    |                | they are executed.                          |          |
+    +----------------+---------------------------------------------+----------+
+    | ``showbinary`` | Whether or not to show data from binary     | ``false``|
+    |                | (BLOB and CLOB) columns. If ``true``, the   |          |
+    |                | value of ``binarymax`` dictates how many    |          |
+    |                | bytes to display.                           |          |
+    +----------------+---------------------------------------------+----------+
+    | ``stacktrace`` | Whether to display a Python stack trace on  | ``false``|
+    |                | normal (i.e., expected) errors, like SQL    |          |
+    |                | syntax errors.                              |          |
+    +----------------+---------------------------------------------+----------+
+    | ``timings``    | Whether to display execution times for SQL  | ``true`` |
+    |                | statements.                                 |          |
+    +----------------+---------------------------------------------+----------+
+
+``.show``
+~~~~~~~~~
+
+The ``.show`` command currently only supports one parameter: ``tables``.
+It's used to display the names of all tables in the database.
+
+Command History
+---------------
+
+*sqlcmd* supports a `bash`_-like command history mechanism. Every command
+you type at the command prompt is saved in an internal memory buffer, accessible
+via the ``.history`` command.
+
+.. _bash: http://www.gnu.org/software/bash/manual/
+
+Because *sqlcmd* also supports GNU Readline, you can use the standard GNU
+Readline key bindings to scroll through your history list, edit previous
+commands, and re-issue them.
+
+Upon exit, *sqlcmd* saves its internal history buffer to a database-specific
+file. The file's name is adapted from the primary name of the database (*i.e.*,
+from the section name for the database in the configuration file). The
+history files are stored in directory ``.sqlcmd`` under your home directory.
+History files always end with &quot;.hist&quot;.
+
+For example, consider this configuration file:
+
+.. code-block:: ini
+
+
+    [db.testdb]
+    names=sqlite, test
+    database=/tmp/test.db
+    type=sqlite
+
+    [db.customers]
+    names=oracle
+    database=customers
+    type=oracle
+    host=db.example.com
+    user=scott
+    password=tiger
+
+The history file for the first database is ``$HOME/.sqlcmd/testdb.hist``, and
+the history file for the second database is ``$HOME/.sqlcmd/customers.hist.``
+
+License and Copyright
+=====================
+
+Copyright &#169; 2008 Brian M. Clapper
+
+This is free software, released under the following BSD-like license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+2. The end-user documentation included with the redistribution, if any,
+   must include the following acknowledgement:
+
+   This product includes software developed by Brian M. Clapper
+   (bmc@clapper.org, http://www.clapper.org/bmc/). That software is
+   copyright &#169; 2008 Brian M. Clapper.
+
+   Alternately, this acknowlegement may appear in the software itself, if
+   and wherever such third-party acknowlegements normally appear.
+
+THIS SOFTWARE IS PROVIDED **AS IS** AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL BRIAN M. CLAPPER BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </diff>
      <filename>doc/users_guide.rst</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ debug.err-values = {None: {}}
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                             'windows': [{'name': '3DgIXgv2hehKSHb9uE8x0HCzRM'\
         '03CyRo',
-        'size-state': '',
+        'size-state': 'maximized',
         'type': 'dock',
         'view': {'area': 'tall',
                  'current_pages': [0,
@@ -196,23 +196,6 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         'primary_view_state': {'editor_states': ('horizontal',
         0.5,
         {'bookmarks': ([(loc('sqlcmd/__init__.py'),
-                         {'attrib-starts': [],
-                          'first-line': 0,
-                          'sel-line': 0,
-                          'sel-line-start': 0,
-                          'selection_end': 0,
-                          'selection_start': 0},
-                         1212170206.6391749),
-                        (loc('sqlcmd/__init__.py'),
-                         {'attrib-starts': [('DBInstanceConfigItem',
-        158)],
-                          'first-line': 128,
-                          'sel-line': 158,
-                          'sel-line-start': 4995,
-                          'selection_end': 5021,
-                          'selection_start': 5001},
-                         1212170210.078963),
-                        (loc('sqlcmd/__init__.py'),
                          {'attrib-starts': [('SQLCmdConfig',
         184)],
                           'first-line': 172,
@@ -369,15 +352,33 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                           'selection_end': 6303,
                           'selection_start': 6303},
                          1216150344.3194599),
+                        (loc('doc/users_guide.rst'),
+                         {'attrib-starts': [],
+                          'first-line': 272,
+                          'folded-linenos': [],
+                          'sel-line': 313,
+                          'sel-line-start': 10124,
+                          'selection_end': 10137,
+                          'selection_start': 10133},
+                         1216150345.583427),
+                        (loc('doc/users_guide.rst'),
+                         {'attrib-starts': [],
+                          'first-line': 211,
+                          'folded-linenos': [],
+                          'sel-line': 251,
+                          'sel-line-start': 8024,
+                          'selection_end': 8039,
+                          'selection_start': 8035},
+                         1216221479.6822381),
                         [loc('doc/users_guide.rst'),
                          {'attrib-starts': [],
-                          'first-line': 128,
+                          'first-line': 211,
                           'folded-linenos': [],
-                          'sel-line': 189,
-                          'sel-line-start': 6289,
-                          'selection_end': 6303,
-                          'selection_start': 6303},
-                         1216150345.583427]],
+                          'sel-line': 251,
+                          'sel-line-start': 8024,
+                          'selection_end': 8039,
+                          'selection_start': 8035},
+                         1216221481.688972]],
                        19),
          'current-loc': loc('doc/users_guide.rst'),
          'editor-states': {loc('doc/style.css'): {'attrib-starts': [],
@@ -388,12 +389,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         'selection_end': 503,
         'selection_start': 503},
                            loc('doc/users_guide.rst'): {'attrib-starts': [],
-        'first-line': 146,
+        'first-line': 353,
         'folded-linenos': [],
-        'sel-line': 170,
-        'sel-line-start': 5917,
-        'selection_end': 5933,
-        'selection_start': 5933},
+        'sel-line': 384,
+        'sel-line-start': 13977,
+        'selection_end': 14018,
+        'selection_start': 14018},
                            loc('setup.py'): {'attrib-starts': [],
         'first-line': 0,
         'sel-line': 0,
@@ -417,42 +418,6 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         {'bookmarks': ([(loc('sqlcmd/__init__.py'),
                          {'attrib-starts': [('Main',
         1234),
-        ('Main.run',
-         1239)],
-                          'first-line': 1239,
-                          'folded-linenos': [],
-                          'sel-line': 1244,
-                          'sel-line-start': 39749,
-                          'selection_end': 39793,
-                          'selection_start': 39782},
-                         1216002291.4616251),
-                        (loc('sqlcmd/__init__.py'),
-                         {'attrib-starts': [('Main',
-        1234),
-        ('Main.run',
-         1239)],
-                          'first-line': 1239,
-                          'folded-linenos': [],
-                          'sel-line': 1244,
-                          'sel-line-start': 39749,
-                          'selection_end': 39810,
-                          'selection_start': 39810},
-                         1216002295.408875),
-                        (loc('sqlcmd/__init__.py'),
-                         {'attrib-starts': [('Main',
-        1234),
-        ('Main.__parse_params',
-         1294)],
-                          'first-line': 1272,
-                          'folded-linenos': [],
-                          'sel-line': 1326,
-                          'sel-line-start': 42817,
-                          'selection_end': 42840,
-                          'selection_start': 42840},
-                         1216002299.591068),
-                        (loc('sqlcmd/__init__.py'),
-                         {'attrib-starts': [('Main',
-        1234),
         ('Main.__parse_params',
          1294)],
                           'first-line': 1241,
@@ -638,18 +603,56 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                           'selection_end': 19783,
                           'selection_start': 19779},
                          1216157761.2642679),
+                        (loc('sqlcmd/__init__.py'),
+                         {'attrib-starts': [('SQLCmd',
+        400),
+        ('SQLCmd.__init__',
+         426),
+        ('SQLCmd.__init__.autocommitChanged',
+         440)],
+                          'first-line': 437,
+                          'folded-linenos': [],
+                          'sel-line': 445,
+                          'sel-line-start': 14216,
+                          'selection_end': 14250,
+                          'selection_start': 14250},
+                         1216157821.9800711),
+                        (loc('sqlcmd/__init__.py'),
+                         {'attrib-starts': [('SQLCmd',
+        400),
+        ('SQLCmd.__load_file',
+         1224)],
+                          'first-line': 1193,
+                          'folded-linenos': [],
+                          'sel-line': 1224,
+                          'sel-line-start': 39130,
+                          'selection_end': 39149,
+                          'selection_start': 39138},
+                         1216221521.8594389),
+                        (loc('sqlcmd/__init__.py'),
+                         {'attrib-starts': [('SQLCmd',
+        400),
+        ('SQLCmd.do_dot_show',
+         793)],
+                          'first-line': 737,
+                          'folded-linenos': [],
+                          'sel-line': 793,
+                          'sel-line-start': 25154,
+                          'selection_end': 25168,
+                          'selection_start': 25162},
+                         1216221525.6479809),
                         [loc('sqlcmd/__init__.py'),
                          {'attrib-starts': [('SQLCmd',
         400),
-        ('SQLCmd.precmd',
-         515)],
-                          'first-line': 551,
-                          'folded-linenos': [],
-                          'sel-line': 597,
-                          'sel-line-start': 19748,
-                          'selection_end': 19783,
-                          'selection_start': 19779},
-                         1216157821.9800711]],
+        ('SQLCmd.do_dot_show',
+         793)],
+                          'first-line': 737,
+                          'folded-linenos': [],
+                          'sel-line': 793,
+                          'sel-line-start': 25154,
+                          'selection_end': 25168,
+                          'selection_start': 25162},
+                         1216221575.054013]],
                        19),
          'current-loc': loc('sqlcmd/__init__.py'),
          'editor-states': {loc('doc/style.css'): {},
@@ -664,14 +667,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                            loc('sqlcmd/__init__.py'): {'attrib-starts': [('S'\
         'QLCmd',
         400),
-        ('SQLCmd.precmd',
-         515)],
-        'first-line': 551,
+        ('SQLCmd.do_dot_load',
+         847)],
+        'first-line': 834,
         'folded-linenos': [],
-        'sel-line': 597,
-        'sel-line-start': 19646,
-        'selection_end': 19675,
-        'selection_start': 19675},
+        'sel-line': 852,
+        'sel-line-start': 26914,
+        'selection_end': 26930,
+        'selection_start': 26930},
                            loc('sqlcmd/history.py'): {'attrib-starts': [],
         'first-line': 26,
         'folded-linenos': [],
@@ -696,7 +699,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         'window-alloc': (10,
                          25,
                          1660,
-                         972)},
+                         945)},
         {'name': 'nz8sdCZFY1fM2ZHHgdqsqa9sPhFohhIY',
          'size-state': '',
          'type': 'panel-tall',
@@ -722,8 +725,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                           378,
                           1102,
                           116)}]}
-guimgr.recent-documents = [loc('sqlcmd/__init__.py'),
-                           loc('doc/users_guide.rst')]
+guimgr.recent-documents = [loc('doc/users_guide.rst'),
+                           loc('sqlcmd/history.py'),
+                           loc('sqlcmd/__init__.py')]
 guimgr.visual-state = {loc('doc/users_guide.rst'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
@@ -744,7 +748,7 @@ guimgr.visual-state = {loc('doc/users_guide.rst'): {'attrib-starts': [],
         'sel-line-start': 790,
         'selection_end': 817,
         'selection_start': 817},
-                       loc('unknown:&lt;untitled&gt; #10'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #1'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'history': {},
@@ -752,115 +756,115 @@ guimgr.visual-state = {loc('doc/users_guide.rst'): {'attrib-starts': [],
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #21'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #3'): {'attrib-starts': [],
         'first-line': 0,
-        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #19'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #2'): {'attrib-starts': [],
         'first-line': 0,
+        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #15'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #4'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #25'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #5'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #28'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #10'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #24'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #8'): {'attrib-starts': [],
         'first-line': 0,
+        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #22'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #12'): {'attrib-starts': [],
         'first-line': 0,
-        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #20'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #11'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #26'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #14'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #18'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #6'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #23'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #9'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #27'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #16'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #17'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #15'): {'attrib-starts': [],
         'first-line': 0,
+        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #16'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #7'): {'attrib-starts': [],
         'first-line': 0,
-        'folded-linenos': [],
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #14'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #13'): {'attrib-starts': [],
         'first-line': 0,
         'history': {},
         'sel-line': 0,
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #13'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #17'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'history': {},
@@ -868,7 +872,7 @@ guimgr.visual-state = {loc('doc/users_guide.rst'): {'attrib-starts': [],
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #11'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #18'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'history': {},
@@ -876,7 +880,7 @@ guimgr.visual-state = {loc('doc/users_guide.rst'): {'attrib-starts': [],
         'sel-line-start': 0,
         'selection_end': 0,
         'selection_start': 0},
-                       loc('unknown:&lt;untitled&gt; #12'): {'attrib-starts': [],
+                       loc('unknown:&lt;untitled&gt; #19'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'history': {},</diff>
      <filename>sqlcmd.wpr</filename>
    </modified>
    <modified>
      <diff>@@ -240,6 +240,8 @@ class SQLCmdConfig(object):
         password = cfg.get(section, 'password', optional=True)
         db_type = cfg.get(section, 'type')
 
+        aliases += [db_name]
+
         try:
             cfg_item = DBInstanceConfigItem(section,
                                             aliases,
@@ -409,11 +411,6 @@ class SQLCmd(Cmd):
                              for x in range(256)])
 
     NO_SEMI_NEEDED = set()
-    NO_SEMI_NEEDED.add('load')
-    NO_SEMI_NEEDED.add('connect')
-    NO_SEMI_NEEDED.add('h')
-    NO_SEMI_NEEDED.add('history')
-    NO_SEMI_NEEDED.add('hist')
     NO_SEMI_NEEDED.add('help')
     NO_SEMI_NEEDED.add('?')
     NO_SEMI_NEEDED.add('r')
@@ -447,7 +444,7 @@ class SQLCmd(Cmd):
                     db.commit()
 
         vars = [
-            Variable('echo',       SQLCmd.VAR_TYPES.boolean, True,
+            Variable('echo',       SQLCmd.VAR_TYPES.boolean, False,
                      'Whether or not SQL statements are echoed.'),
             Variable('timings',    SQLCmd.VAR_TYPES.boolean, True,
                      'Whether or not to show how SQL statements take.'),
@@ -540,6 +537,16 @@ class SQLCmd(Cmd):
 
         self.__scrub_history()
 
+        if first.startswith('@'):
+            first = SQLCmd.META_COMMAND_PREFIX + 'load'
+            if len(first) &gt; 1:
+                args = [first[1:]] + args
+
+        elif first.startswith('!'):
+            first = 'r'
+            if len(first) &gt; 1:
+                args = [first[1:]] + args
+
         need_semi = not first in SQLCmd.NO_SEMI_NEEDED;
         if first.startswith(SQLCmd.COMMENT_PREFIX):
             # Comments are handled specially. Rather than transform them
@@ -558,14 +565,6 @@ class SQLCmd(Cmd):
             skip_history = True
             need_semi = False
 
-        elif first.startswith('@'):
-            if len(first) &gt; 1:
-                first = 'load ' + first[1:]
-            else:
-                first = 'load'
-            s = ' '.join([first] + args)
-            need_semi = False
-
         else:
             s = ' '.join([first] + args)
 
@@ -599,79 +598,12 @@ class SQLCmd(Cmd):
 
         return s
 
-    def do_load(self, args):
-        &quot;&quot;&quot;
-        Load and run a file full of commands without exiting the command
-        shell.
-
-        Usage: load file
-               @ file
-               @file
-        &quot;&quot;&quot;
-        tokens = args.split(None, 1)
-        if len(tokens) &gt; 1:
-            raise BadCommandError, 'Too many arguments to &quot;load&quot; (&quot;@&quot;)'
-
-        try:
-            self.__load_file(tokens[0])
-        except IOError, (ex, msg):
-            error('Unable to load file &quot;%s&quot;: %s' % (tokens[0], msg))
-
-    def do_connect(self, args):
-        &quot;&quot;&quot;
-        Close the current database connection, and connect to another
-        database.
-
-        Usage: connect database_alias
-
-        where 'database_alias' is a valid database alias from the .sqlcmd
-        startup file.
-        &quot;&quot;&quot;
-        tokens = args.split(None, 1)
-        if len(tokens) &gt; 1:
-            raise BadCommandError, 'Too many arguments to &quot;connect&quot;'
-
-        if self.__db != None:
-            try:
-                self.__db.close()
-            except db.Error:
-                pass
-            self.set_database(tokens[0])
-            assert(self.__db_config != None)
-            self.__connect_to(self.__db_config)
-
-    def do_h(self, args):
-        &quot;&quot;&quot;
-        Show the current command history. Identical to the 'hist' and
-        'history' commands.
-
-        Usage: h
-        &quot;&quot;&quot;
-        self.__show_history()
-
-    def do_hist(self, args):
-        &quot;&quot;&quot;
-        Show the current command history. Identical to the 'h' command and
-        'history' commands.
-
-        Usage: hist
-        &quot;&quot;&quot;
-        self.__show_history()
-
-    def do_history(self, args):
-        &quot;&quot;&quot;
-        Show the current command history. Identical to the 'h' command and
-        'hist' commands.
-
-        Usage: history
-        &quot;&quot;&quot;
-        self.__show_history()
-
     def do_r(self, args):
         &quot;&quot;&quot;
         Re-run a command.
 
         Usage: r [num]
+               ![num]
 
         where 'num' is the number of the command to re-run, as shown in the
         'history' display. If 'num' is omitted, re-run the most previously
@@ -832,6 +764,33 @@ class SQLCmd(Cmd):
         except ValueError:
                 raise BadCommandError, 'Bad argument to &quot;set %s&quot;' % varname
         
+    def do_dot_h(self, args):
+        &quot;&quot;&quot;
+        Show the current command history. Identical to the 'hist' and
+        'history' commands.
+
+        Usage: .h
+        &quot;&quot;&quot;
+        self.__show_history()
+
+    def do_dot_hist(self, args):
+        &quot;&quot;&quot;
+        Show the current command history. Identical to the 'h' command and
+        'history' commands.
+
+        Usage: .hist
+        &quot;&quot;&quot;
+        self.__show_history()
+
+    def do_dot_history(self, args):
+        &quot;&quot;&quot;
+        Show the current command history. Identical to the 'h' command and
+        'hist' commands.
+
+        Usage: .history
+        &quot;&quot;&quot;
+        self.__show_history()
+
     def do_dot_show(self, args):
         &quot;&quot;&quot;
         Run the &quot;show&quot; command.
@@ -886,6 +845,50 @@ class SQLCmd(Cmd):
         finally:
             cursor.close()
 
+    def do_dot_load(self, args):
+        &quot;&quot;&quot;
+        Load and run a file full of commands without exiting the command
+        shell.
+
+        Usage: .load file
+               @ file
+               @file
+        &quot;&quot;&quot;
+        tokens = args.split(None, 1)
+        if len(tokens) &gt; 1:
+            raise BadCommandError, 'Too many arguments to &quot;load&quot; (&quot;@&quot;)'
+
+        try:
+            self.__load_file(tokens[0])
+        except IOError, (ex, msg):
+            error('Unable to load file &quot;%s&quot;: %s' % (tokens[0], msg))
+
+    def do_dot_connect(self, args):
+        &quot;&quot;&quot;
+        Close the current database connection, and connect to another
+        database.
+
+        Usage: connect database_alias
+
+        where 'database_alias' is a valid database alias from the .sqlcmd
+        startup file.
+        &quot;&quot;&quot;
+        tokens = args.split(None, 1)
+        if len(tokens) &gt; 1:
+            raise BadCommandError, 'Too many arguments to &quot;connect&quot;'
+
+        if len(tokens) == 0:
+            raise BadCommandError, 'Usage: .connect databasename'
+
+        if self.__db != None:
+            try:
+                self.__db.close()
+            except db.Error:
+                pass
+            self.set_database(tokens[0])
+            assert(self.__db_config != None)
+            self.__connect_to(self.__db_config)
+
     def help_variables(self):
         print &quot;&quot;&quot;
         There are various variables that control the behavior of sqlcmd.</diff>
      <filename>sqlcmd/__init__.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>43776ac7a4902e95abfd52d7c8196608b181f657</id>
    </parent>
  </parents>
  <author>
    <name>Brian Clapper</name>
    <email>bmc@clapper.org</email>
  </author>
  <url>http://github.com/bmc/sqlcmd/commit/e9b3636112ea7a6f61657248552eb91304163b98</url>
  <id>e9b3636112ea7a6f61657248552eb91304163b98</id>
  <committed-date>2008-07-16T12:26:54-07:00</committed-date>
  <authored-date>2008-07-16T12:26:54-07:00</authored-date>
  <message>1. Initial draft of User's Guide is complete.
2. Some command changes, based on stuff that came up during the user's guide
   draft.
3. Added LICENSE and README.</message>
  <tree>be0a39e51e997cce7207726c9a4a0b1e758c11d1</tree>
  <committer>
    <name>Brian Clapper</name>
    <email>bmc@clapper.org</email>
  </committer>
</commit>
