![]() |
![]() |
![]() |
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-4.0:
gda-sql-4.0 [--help] [-l] [-L] [-C command] [-f commands file] [-o output file] [-p] [connection specification...]
The options are the following ones:
the --help option gives a short help summary
the -l and -L options respectively output a list of the defined data sources (DSN) and of the installed database adaptaters (database providers):
[prompt]> gda-sql-4.0 -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-4.0 -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 -C and -f options repectively allow one to specify a single command to be run or a filename containing the commands to run before the tool exits
the -o option allows to specify a file to write the output to
the -p speficies that the tool should not ask for passwords when a username has been specified for a connection but no password has been specified.
Connections to be opened can be specified on the command line using either:
defined data sources (the ones listed using the -l option)
connection strings which have the following format: "[<provider>://][<username>[:<password>]@]<connection_params>". 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-4.0 Sales [prompt]> gda-sql-4.0 Postgresql://username@DB_NAME=mydb SQLite://DB_NAME=fspot Sales [prompt]> gda-sql-4.0 path/to/dbfile.db