| GNOME Data Access 4.0 manual |
|---|
The Libgda's SQL console tool runs is a terminal emulator, and can be launched using the gda-sql (or gda-sql-<version> for a specific version):
gda-sql [--help] [-l] [-L] [-C command] [-f commands file] [-o output file] [-sport to use to run embedded HTTP server] [-tauthentication token required to authenticate clients when running the embedded HTTP server] [connection specification...]
The options are the following ones:
the
--helpoption gives a short help summary-
the
-land-Loptions respectively output a list of the defined data sources (DSN) and of the installed database adaptaters (database providers):[prompt]> gda-sql -l List of defined data sources DSN | Provider | Description | Connection string | Username | Global ----------+----------+--------------------------------------+-----------------------+----------+------- SalesTest | SQLite | Test database for a sales department | DB_NAME=sales_test.db | | FALSE (1 row)
[prompt]> gda-sql -L List of installed providers Provider | Description | DSN parameters | Authentication | File ------------+-------------------------------------+--------------------+----------------+---------------------- ------------------------------------- PostgreSQL | Provider for PostgreSQL databases | DB_NAME, | USERNAME, | [...]libgda-postgres.so SEARCHPATH, PASSWORD HOST, PORT, OPTIONS, USE_SSL MSAccess | Provider for Microsoft Access files | DB_NAME, | | [...]libgda-mdb.so DB_DIR [...] the
-Cand-foptions repectively allow one to specify a single command to be run or a filename containing the commands to run before the tool exitsthe
-ooption allows to specify a file to write the output tothe
-srequests the embedded HTTP server to be executed, listening on the port specified.the
-tspecifies a token string which clients will have to supply to authenticate themselves to the HTTP server, if running.
Connections to be opened can be specified on the command line using either:
defined data sources (the ones listed using the
-loption)connection strings which have the following format: "[<provider>://][<username>[:<password>]@]<connection_params>". If a username or password is required, and is not specified either by a DSN's definition or in the connection string, then it will be requested dynamically. Note that if provided, <username>, <password> and <provider> must be encoded as per RFC 1738
for SQLite and MS Access files: the file name
Connections can also be opened while the tool is running using the .c internal command.
Examples:
[prompt]> gda-sql Sales
[prompt]> gda-sql Postgresql://username@DB_NAME=mydb SQLite://DB_NAME=fspot Sales
[prompt]> gda-sql path/to/dbfile.db
