Kexi/Handbook/References/Command-Line Options: Difference between revisions

From KDE UserBase Wiki
(prepare for translation)
m (KEXI uppercase)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languges />
<languages />


<translate>
<translate>


===Usage===
===Usage=== <!--T:1-->


The [https://en.wikipedia.org/wiki/Command-line_interface command-line interface] provides the option to start the KEXI application, conveniently open projects within its environment, and carry out specific additional actions.
<!--T:2-->
The [https://en.wikipedia.org/wiki/Command-line_interface command-line interface] provides the option to start the '''KEXI''' application, conveniently open projects within its environment, and carry out specific additional actions.


A general way to start the KEXI application:
<!--T:3-->
A general way to start the '''KEXI''' application:


<!--T:4-->
{{Input|1=<nowiki>kexi [options] file</nowiki>}}
{{Input|1=<nowiki>kexi [options] file</nowiki>}}


<!--T:5-->
<tt>file</tt> is a '''KEXI''' database project file, '''KEXI''' shortcut filename, or name of a '''KEXI''' database project on a server to open.
<tt>file</tt> is a '''KEXI''' database project file, '''KEXI''' shortcut filename, or name of a '''KEXI''' database project on a server to open.


<!--T:6-->
{{Note|It is possible that the command <tt>kexi</tt> on your computer should be in the form of <tt>kexi-3.2</tt> or <tt>kexi-3.3</tt>, depending on the version of the application installed. Such version-dependent naming of KEXI executable facilitate installation of multiple versions of KEXI.}}
{{Note|It is possible that the command <tt>kexi</tt> on your computer should be in the form of <tt>kexi-3.2</tt> or <tt>kexi-3.3</tt>, depending on the version of the application installed. Such version-dependent naming of KEXI executable facilitate installation of multiple versions of KEXI.}}


===Options related to entire projects===
===Options related to entire projects=== <!--T:7-->


<!--T:8-->
;<tt>--createdb</tt>
;<tt>--createdb</tt>
:Create a new, blank project using specified database driver and database name and exit immediately. You will be asked for confirmation if overwriting is needed.
:Create a new, blank project using specified database driver and database name and exit immediately. You will be asked for confirmation if overwriting is needed.


<!--T:9-->
;<tt>--create-opendb</tt>
;<tt>--create-opendb</tt>
:Like <tt>--createdb</tt>, but also open newly created database.
:Like <tt>--createdb</tt>, but also open newly created database.


<!--T:10-->
;<tt>--dropdb</tt>
;<tt>--dropdb</tt>
:Drop (remove) a project using specified database driver and database name. You will be asked for confirmation.
:Drop (remove) a project using specified database driver and database name. You will be asked for confirmation.


<!--T:11-->
;<tt>--drv</tt>, <tt>--dbdriver <name_or_id></tt>
;<tt>--drv</tt>, <tt>--dbdriver <name_or_id></tt>
:Name of a database driver to be used when connecting to a database project ("sqlite" by default). Ignored if a shortcut filename is provided. Complete KDb-specific globally unique identifier can be used, e.g. <tt>"org.kde.kdb.sqlite"</tt> to specify exact vendor of the driver.
:Name of a database driver to be used when connecting to a database project ("sqlite" by default). Ignored if a shortcut filename is provided. Complete KDb-specific globally unique identifier can be used, e.g. <tt>"org.kde.kdb.sqlite"</tt> to specify exact vendor of the driver.


<!--T:12-->
;<tt>-t</tt>, <tt>--type <name></tt>
;<tt>-t</tt>, <tt>--type <name></tt>
:Specify the type of file provided as an argument. This option is only useful if the filename does not have a valid extension set and its type cannot be determined unambiguously by examining its contents. This option is ignored if no file is specified as an argument. Available file types are:
:Specify the type of file provided as an argument. This option is only useful if the filename does not have a valid extension set and its type cannot be determined unambiguously by examining its contents. This option is ignored if no file is specified as an argument. Available file types are:


<!--T:13-->
* <tt>"project"</tt> for a project file (the default)
* <tt>"project"</tt> for a project file (the default)


<!--T:14-->
* <tt>"shortcut"</tt> for a shortcut file pointing to a project.
* <tt>"shortcut"</tt> for a shortcut file pointing to a project.


<!--T:15-->
* <tt>"connection"</tt> for database connection data.
* <tt>"connection"</tt> for database connection data.


<!--T:16-->
;<tt>--conn</tt>, <tt>--connection <shortcut_filename></tt>
;<tt>--conn</tt>, <tt>--connection <shortcut_filename></tt>
:Specify a database connection shortcut <tt>.kexic</tt> file containing connection data. Can be used with <tt>--createdb</tt> or <tt>--create-opendb</tt> for convenience instead of using options such as <tt>--user</tt>, <tt>--host</tt> or <tt>--port</tt>. Note: Options like <tt>--user</tt>, <tt>--host</tt> have precedence over settings defined in the shortcut file.
:Specify a database connection shortcut <tt>.kexic</tt> file containing connection data. Can be used with <tt>--createdb</tt> or <tt>--create-opendb</tt> for convenience instead of using options such as <tt>--user</tt>, <tt>--host</tt> or <tt>--port</tt>. Note: Options like <tt>--user</tt>, <tt>--host</tt> have precedence over settings defined in the shortcut file.


<!--T:17-->
;<tt>--readonly</tt>
;<tt>--readonly</tt>
:Specify that any database connections will be performed without write support. This option is ignored when <tt>--createdb</tt> option is present, otherwise the database could not be created.
:Specify that any database connections will be performed without write support. This option is ignored when <tt>--createdb</tt> option is present, otherwise the database could not be created.


===Options related to opening objects===
===Options related to opening objects=== <!--T:18-->


<!--T:19-->
;<tt>--open <[object_type:]object_name></tt>
;<tt>--open <[object_type:]object_name></tt>
:Open object of type <tt>'object_type'</tt> and name <tt>'object_name'</tt> from specified project on application start. <tt>'object_type'</tt> is optional, if omitted - table type is assumed. Other object types can be <tt>query</tt>, <tt>form</tt>, <tt>report</tt>, <tt>script</tt>. There may by more or less types available depending on '''KEXI''' plugins installed. Use <tt>""</tt> characters to specify names containing spaces. Examples: <tt>--open MyTable</tt>, <tt>--open query:"My very big query"</tt>
:Open object of type <tt>'object_type'</tt> and name <tt>'object_name'</tt> from specified project on application start. <tt>'object_type'</tt> is optional, if omitted - table type is assumed. Other object types can be <tt>query</tt>, <tt>form</tt>, <tt>report</tt>, <tt>script</tt>. There may by more or less types available depending on '''KEXI''' plugins installed. Use <tt>""</tt> characters to specify names containing spaces. Examples: <tt>--open MyTable</tt>, <tt>--open query:"My very big query"</tt>


<!--T:20-->
;<tt>--design <[object_type:]object_name></tt>
;<tt>--design <[object_type:]object_name></tt>
:Like <tt>--open</tt>, but the object will be opened in Design Mode, if one is available.
:Like <tt>--open</tt>, but the object will be opened in Design Mode, if one is available.


<!--T:21-->
;<tt>--edittext <[object_type:]object_name></tt>
;<tt>--edittext <[object_type:]object_name></tt>
:Like <tt>--open</tt>, but the object will be opened in Text Mode, if one is available.
:Like <tt>--open</tt>, but the object will be opened in Text Mode, if one is available.


<!--T:22-->
;<tt>--execute</tt>, <tt>--exec <[object_type:]object_name></tt>
;<tt>--execute</tt>, <tt>--exec <[object_type:]object_name></tt>
:Start execution of object of type <tt>'object_type'</tt> and name <tt>'object_name'</tt> on application start. <tt>'object_type'</tt> is optional, if omitted - macro type is assumed. Object type can be also script. There may by more or less types available depending on '''KEXI''' plugins installed. Use <tt>""</tt> characters to specify names containing spaces.
:Start execution of object of type <tt>'object_type'</tt> and name <tt>'object_name'</tt> on application start. <tt>'object_type'</tt> is optional, if omitted - macro type is assumed. Object type can be also script. There may by more or less types available depending on '''KEXI''' plugins installed. Use <tt>""</tt> characters to specify names containing spaces.


<!--T:23-->
;<tt>--new <object_type></tt>
;<tt>--new <object_type></tt>
:Start design of a new object of type <tt>'object_type'</tt>.
:Start design of a new object of type <tt>'object_type'</tt>.


===Options related to database servers===
===Options related to database servers=== <!--T:24-->


<!--T:25-->
;<tt>-u</tt>, <tt>--user</tt>
;<tt>-u</tt>, <tt>--user</tt>
:Database server's user name when connecting to a project. Ignored if the project is opened using a shortcut file. Default user name is the same as the current login (user name).
:Database server's user name when connecting to a project. Ignored if the project is opened using a shortcut file. Default user name is the same as the current login (user name).


<!--T:26-->
;<tt>--host <name></tt>
;<tt>--host <name></tt>
:Network server's (host) name to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Default host is the local computer.
:Network server's (host) name to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Default host is the local computer.


<!--T:27-->
;<tt>--port <number></tt>
;<tt>--port <number></tt>
:Network server's port number to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).
:Network server's port number to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).


<!--T:28-->
;<tt>--socket</tt>, <tt>--local-socket <filename></tt>
;<tt>--socket</tt>, <tt>--local-socket <filename></tt>
:Local computer's socket filename to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).
:Local computer's socket filename to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).


<!--T:29-->
;<tt>--skip-conn-dialog</tt>
;<tt>--skip-conn-dialog</tt>
:Skip displaying connection dialog window and connect directly. Available when opening <tt>.kexic</tt> or <tt>.kexis</tt> shortcut files.
:Skip displaying connection dialog window and connect directly. Available when opening <tt>.kexic</tt> or <tt>.kexis</tt> shortcut files.


===Options related to application mode or appearance===
===Options related to application mode or appearance=== <!--T:30-->


<!--T:31-->
;<tt>--user-mode</tt>
;<tt>--user-mode</tt>
:Start project in ''User Mode'', regardless of the project settings.
:Start project in ''User Mode'', regardless of the project settings.


<!--T:32-->
;<tt>--design-mode</tt>
;<tt>--design-mode</tt>
:Start project in Design Mode, regardless of the project settings.
:Start project in Design Mode, regardless of the project settings.


<!--T:33-->
;<tt>--show-navigator</tt>
;<tt>--show-navigator</tt>
:Show the Project Navigator side pane even if '''KEXI''' runs in ''User Mode''.
:Show the Project Navigator side pane even if '''KEXI''' runs in ''User Mode''.


<!--T:34-->
;<tt>--hide-menu</tt>
;<tt>--hide-menu</tt>
:Hide the main menu (the tabbed toolbar) completely. A number of commands from the main menu is still visible. This option is useful in ''User Mode''.
:Hide the main menu (the tabbed toolbar) completely. A number of commands from the main menu is still visible. This option is useful in ''User Mode''.


<!--T:35-->
;<tt>-f</tt>, <tt>--fullscreen</tt>
;<tt>-f</tt>, <tt>--fullscreen</tt>
:Start '''KEXI''' in full screen mode to occupy the whole screen area by hiding window decorations such as title bars.
:Start '''KEXI''' in full screen mode to occupy the whole screen area by hiding window decorations such as title bars.


===Obtaining help and other information===
===Obtaining help and other information=== <!--T:36-->


<!--T:37-->
;<tt>-h</tt>, <tt>--help</tt>
;<tt>-h</tt>, <tt>--help</tt>
:Displays help on commandline options.
:Displays help on commandline options.


<!--T:38-->
;<tt>--help-all</tt>
;<tt>--help-all</tt>
:Displays help including Qt specific options.
:Displays help including Qt specific options.


<!--T:39-->
;<tt>-v</tt>, <tt>--version</tt>
;<tt>-v</tt>, <tt>--version</tt>
:Displays version information.
:Displays version information.


<!--T:40-->
;<tt>--author</tt>
;<tt>--author</tt>
:Show author information.
:Show author information.


<!--T:41-->
;<tt>--license</tt>
;<tt>--license</tt>
:Show license information.
:Show license information.


<!--T:42-->
;<tt>--list-plugins</tt>
;<tt>--list-plugins</tt>
:Display list of plugins available for '''KEXI''' with their  name, description, version and filenames.
:Display list of plugins available for '''KEXI''' with their  name, description, version and filenames.


===Notes===
===Notes=== <!--T:43-->


<!--T:44-->
* If none of the below options are used, '''KEXI''' will open specified file (project).
* If none of the below options are used, '''KEXI''' will open specified file (project).


<!--T:45-->
* Database driver names and object names are case-insensitive.
* Database driver names and object names are case-insensitive.


<!--T:46-->
* The ''User Mode'' limits the features of '''KEXI''' to data entry and modification, executing of scripts and actions. In ''User mode'', it is not allowed to modify project's design, eg. to add a table or form, add or remove table columns. Design mode, which is the default mode, allows all design actions.
* The ''User Mode'' limits the features of '''KEXI''' to data entry and modification, executing of scripts and actions. In ''User mode'', it is not allowed to modify project's design, eg. to add a table or form, add or remove table columns. Design mode, which is the default mode, allows all design actions.


<!--T:47-->
* In typical case, eg. when the MySQL server is used, a <tt>root</tt> user and password is needed to create new database projects.
* In typical case, eg. when the MySQL server is used, a <tt>root</tt> user and password is needed to create new database projects.


===Example use of command-line options===
===Example use of command-line options=== <!--T:48-->


<!--T:49-->
;<tt>kexi --createdb --dbdriver mysql --user root my_new_project</tt>
;<tt>kexi --createdb --dbdriver mysql --user root my_new_project</tt>
:Creates empty 'my_new_project' project on a local MySQL server (user root is used and will be asked for password).
:Creates empty 'my_new_project' project on a local MySQL server (user root is used and will be asked for password).


<!--T:50-->
;<tt>kexi --createdb my_new_project.kexi</tt>
;<tt>kexi --createdb my_new_project.kexi</tt>
:Creates empty 'my_new_project.kexi' project file (default SQLite driver)
:Creates empty 'my_new_project.kexi' project file (default SQLite driver)


<!--T:51-->
;<tt>kexi --dbdriver postgresql --dropdb project</tt>
;<tt>kexi --dbdriver postgresql --dropdb project</tt>
:drops 'project' from a local PostgreSQL server
:drops 'project' from a local PostgreSQL server


<!--T:52-->
;<tt>kexi --open mytable --edittext query:query1 --design form:form1 project.kexi</tt>
;<tt>kexi --open mytable --edittext query:query1 --design form:form1 project.kexi</tt>
:Opens 'project.kexi' Kexi project file and auto-opens 'mytable' table (in data view), opens 'query1' query in SQL Editor view, and finally, open a form 'form1' for design.
:Opens 'project.kexi' Kexi project file and auto-opens 'mytable' table (in data view), opens 'query1' query in SQL Editor view, and finally, open a form 'form1' for design.


<!--T:53-->
;<tt>kexi --new form project.kexi</tt>
;<tt>kexi --new form project.kexi</tt>
:Starts a new form's design within 'project.kexi'
:Starts a new form's design within 'project.kexi'


<!--T:54-->
;<tt>kexi --user-mode --show-navigator --open form:cars --open form:persons db.kexi</tt>
;<tt>kexi --user-mode --show-navigator --open form:cars --open form:persons db.kexi</tt>
:Opens 'db.kexi' database file in the User Mode, shows the project navigator, and automatically opens 'cars' and 'persons' forms.
:Opens 'db.kexi' database file in the User Mode, shows the project navigator, and automatically opens 'cars' and 'persons' forms.
</translate>
</translate>

Latest revision as of 02:28, 20 December 2024

Other languages:


Usage

The command-line interface provides the option to start the KEXI application, conveniently open projects within its environment, and carry out specific additional actions.

A general way to start the KEXI application:

kexi [options] file

file is a KEXI database project file, KEXI shortcut filename, or name of a KEXI database project on a server to open.

Note

It is possible that the command kexi on your computer should be in the form of kexi-3.2 or kexi-3.3, depending on the version of the application installed. Such version-dependent naming of KEXI executable facilitate installation of multiple versions of KEXI.


Options related to entire projects

--createdb
Create a new, blank project using specified database driver and database name and exit immediately. You will be asked for confirmation if overwriting is needed.
--create-opendb
Like --createdb, but also open newly created database.
--dropdb
Drop (remove) a project using specified database driver and database name. You will be asked for confirmation.
--drv, --dbdriver <name_or_id>
Name of a database driver to be used when connecting to a database project ("sqlite" by default). Ignored if a shortcut filename is provided. Complete KDb-specific globally unique identifier can be used, e.g. "org.kde.kdb.sqlite" to specify exact vendor of the driver.
-t, --type <name>
Specify the type of file provided as an argument. This option is only useful if the filename does not have a valid extension set and its type cannot be determined unambiguously by examining its contents. This option is ignored if no file is specified as an argument. Available file types are:
  • "project" for a project file (the default)
  • "shortcut" for a shortcut file pointing to a project.
  • "connection" for database connection data.
--conn, --connection <shortcut_filename>
Specify a database connection shortcut .kexic file containing connection data. Can be used with --createdb or --create-opendb for convenience instead of using options such as --user, --host or --port. Note: Options like --user, --host have precedence over settings defined in the shortcut file.
--readonly
Specify that any database connections will be performed without write support. This option is ignored when --createdb option is present, otherwise the database could not be created.

Options related to opening objects

--open <[object_type:]object_name>
Open object of type 'object_type' and name 'object_name' from specified project on application start. 'object_type' is optional, if omitted - table type is assumed. Other object types can be query, form, report, script. There may by more or less types available depending on KEXI plugins installed. Use "" characters to specify names containing spaces. Examples: --open MyTable, --open query:"My very big query"
--design <[object_type:]object_name>
Like --open, but the object will be opened in Design Mode, if one is available.
--edittext <[object_type:]object_name>
Like --open, but the object will be opened in Text Mode, if one is available.
--execute, --exec <[object_type:]object_name>
Start execution of object of type 'object_type' and name 'object_name' on application start. 'object_type' is optional, if omitted - macro type is assumed. Object type can be also script. There may by more or less types available depending on KEXI plugins installed. Use "" characters to specify names containing spaces.
--new <object_type>
Start design of a new object of type 'object_type'.

Options related to database servers

-u, --user
Database server's user name when connecting to a project. Ignored if the project is opened using a shortcut file. Default user name is the same as the current login (user name).
--host <name>
Network server's (host) name to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Default host is the local computer.
--port <number>
Network server's port number to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).
--socket, --local-socket <filename>
Local computer's socket filename to be used when connecting to a database project. Ignored if the project is opened using a shortcut file. Defaults depend on the used server type (e.g. MySQL, PostgreSQL).
--skip-conn-dialog
Skip displaying connection dialog window and connect directly. Available when opening .kexic or .kexis shortcut files.

Options related to application mode or appearance

--user-mode
Start project in User Mode, regardless of the project settings.
--design-mode
Start project in Design Mode, regardless of the project settings.
--show-navigator
Show the Project Navigator side pane even if KEXI runs in User Mode.
--hide-menu
Hide the main menu (the tabbed toolbar) completely. A number of commands from the main menu is still visible. This option is useful in User Mode.
-f, --fullscreen
Start KEXI in full screen mode to occupy the whole screen area by hiding window decorations such as title bars.

Obtaining help and other information

-h, --help
Displays help on commandline options.
--help-all
Displays help including Qt specific options.
-v, --version
Displays version information.
--author
Show author information.
--license
Show license information.
--list-plugins
Display list of plugins available for KEXI with their name, description, version and filenames.

Notes

  • If none of the below options are used, KEXI will open specified file (project).
  • Database driver names and object names are case-insensitive.
  • The User Mode limits the features of KEXI to data entry and modification, executing of scripts and actions. In User mode, it is not allowed to modify project's design, eg. to add a table or form, add or remove table columns. Design mode, which is the default mode, allows all design actions.
  • In typical case, eg. when the MySQL server is used, a root user and password is needed to create new database projects.

Example use of command-line options

kexi --createdb --dbdriver mysql --user root my_new_project
Creates empty 'my_new_project' project on a local MySQL server (user root is used and will be asked for password).
kexi --createdb my_new_project.kexi
Creates empty 'my_new_project.kexi' project file (default SQLite driver)
kexi --dbdriver postgresql --dropdb project
drops 'project' from a local PostgreSQL server
kexi --open mytable --edittext query:query1 --design form:form1 project.kexi
Opens 'project.kexi' Kexi project file and auto-opens 'mytable' table (in data view), opens 'query1' query in SQL Editor view, and finally, open a form 'form1' for design.
kexi --new form project.kexi
Starts a new form's design within 'project.kexi'
kexi --user-mode --show-navigator --open form:cars --open form:persons db.kexi
Opens 'db.kexi' database file in the User Mode, shows the project navigator, and automatically opens 'cars' and 'persons' forms.