Kexi/Handbook/References/Command-Line Options: Difference between revisions
m (Simplify section hierarchy) |
(prepare for translation) |
||
Line 1: | Line 1: | ||
<languges /> | |||
<translate> | |||
===Usage=== | ===Usage=== | ||
Line 5: | Line 9: | ||
A general way to start the KEXI application: | A general way to start the KEXI application: | ||
< | {{Input|1=<nowiki>kexi [options] file</nowiki>}} | ||
<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. | ||
Line 12: | Line 16: | ||
===Options related to entire projects=== | ===Options related to entire projects=== | ||
;<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. | ||
;<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. | ||
;<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. | ||
;<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. | ||
;<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: | ||
* <tt>"project"</tt> for a project file (the default) | * <tt>"project"</tt> for a project file (the default) | ||
* <tt>"shortcut"</tt> for a shortcut file pointing to a project. | * <tt>"shortcut"</tt> for a shortcut file pointing to a project. | ||
* <tt>"connection"</tt> for database connection data. | * <tt>"connection"</tt> for database connection data. | ||
;<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. | ||
;<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=== | ||
;<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> | ||
;<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. | ||
;<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. | ||
;<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. | ||
;<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=== | ||
;<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). | ||
;<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. | ||
;<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). | ||
;<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). | ||
;<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=== | ||
;<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. | ||
;<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. | ||
;<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''. | ||
;<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''. | ||
;<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=== | ||
;<tt>-h</tt>, <tt>--help</tt> | ;<tt>-h</tt>, <tt>--help</tt> | ||
:Displays help on commandline options. | :Displays help on commandline options. | ||
;<tt>--help-all</tt> | ;<tt>--help-all</tt> | ||
:Displays help including Qt specific options. | :Displays help including Qt specific options. | ||
;<tt>-v</tt>, <tt>--version</tt> | ;<tt>-v</tt>, <tt>--version</tt> | ||
:Displays version information. | :Displays version information. | ||
;<tt>--author</tt> | ;<tt>--author</tt> | ||
:Show author information. | :Show author information. | ||
;<tt>--license</tt> | ;<tt>--license</tt> | ||
:Show license information. | :Show license information. | ||
;<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=== | ||
* 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). | ||
* Database driver names and object names are case-insensitive. | * 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. | * 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 <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=== | ||
;<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). | ||
;<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) | ||
;<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 | ||
;<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. | ||
;<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' | ||
;<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> |
Revision as of 08:03, 2 September 2023
<languges />
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.
- --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.
- --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'.
- -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.
- --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.