Kexi/Handbook/References/Command-Line Options/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 1: | Line 1: | ||
< | <languages /> | ||
Latest revision as of 08:05, 2 September 2023
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.