dbsql

dbsql [OPTIONS] FILENAME SQL 

dbsql is a command line tool that provides access to the Berkeley DB SQL interface.

To build this tool, run the configure script with the --enable-sql option when you are building the Berkeley DB SQL interface. For more information on building this tool, see "Building for UNIX/POSIX".

FILENAME is the name of a Berkeley DB database file created with the SQL interface. A new database is created if the file does not exist. The options are as follows:

The dbsql executable provides the same interface as the sqlite3 executable that is part of SQLite. For more information on how to use dbsql see the SQLite Documentation page.

Command Line Features Unique to dbsql

This section describes pre-defined query statements that can be executed from the dbsql command line. These queries take the form of:

 .stat ITEM

where ITEM is an optional parameter that indicates what statistics to print. If ITEM is not specified, then this command prints statistics for the Berkeley DB environment, followed by statistics for all tables and indexes within the database.

If ITEM is the name of a table or index, then this command prints statistics for the table or index using the DB->stat_print() method.

Otherwise, ITEM can be one of several keywords. They are:

  • :env:

    dbsql> .stat :env:

    Causes this command to print statistics for the Berkeley DB environment using the DB_ENV->stat_print(). method.

  • :rep:

    dbsql> .stat :rep:

    Causes this command to print a summary of replication statistics.