Jump to content

Kexi/FAQ

From KDE Community Wiki
Revision as of 23:44, 29 December 2024 by Jstaniek (talk | contribs)

KEXI Frequently Asked Questions. Contact us if you have interesting entry for this page.

General Features

What are KEXI features and what is missing?

Read the KEXI Features page. Use the Handbook. For missing features in recent releases look at the "Unsupported features" section of the release document

Should I use a database servers with KEXI?

You can use database server if you need certain features that it provides, but it is not necessary. You can use the file-based built-in database engine that always comes with KEXI, called SQLite. It is very much like MS Access, but more modern, robust, and secure. And well, it's the most widely deployed database engine in the world!

How to use database servers with KEXI?

KEXI can currently connect to PostgreSQL and MySQL servers. Create a new blank database project on your server using KEXI. At first time, you will be asked to provide a connection information such as username and password, and a database name. Later you will be able to reuse this information. You can also use command line options to create and delete database projects.

Please note:

  • KEXI assumes that the account used for the database server has sufficient permissions for database creation and further data modification. If it is not the case you may want to add needed permissions using database administration tools of choice. KEXI does not currently support such administration tasks. If you are unsure how to perform the tasks, ask your database administrators or your support.
  • Currently you can't "open" (i.e. connect to) databases that were created without KEXI. You can only create a new database in KEXI and import existing tables and data from other existing database, or you can import existing database to KEXI, what will duplicate it.
  • The database connection information is stored in so-called .kexis shortcut files for later reuse. Read about them in the Command Line Options documentation.
  • If certain database drivers such as MySQL are missing in the "Creating New Project" assistant, make sure that you have installed KEXI with appropriate support for databases.

How stable is KEXI?

Read the Stability Statement document.

Where can I find KEXI documentation?

A pretty good handbook for KEXI 2 has been published at https://userbase.kde.org/Kexi/Handbook. Translation to other languages may be available.

How could I define database relationships with integrity rules for my tables?

General support for relationships is not yet available. It is however possible to use Combo box widgets to select values in table and form views. This is a simple to one-to-many relationship.

Can I make reports and printouts for my data in KEXI?

KEXI has it's own fully-featured Report Designer which allows to generate report files or print data on printers, and preview the results.

Can I display web pages in KEXI?

There are browser-like web elements for KEXI Forms and Reports that can fetch online or local HTML pages with resources and display them. In Forms they are interactive.

Is it possible to rename a table field in an existing table without losing the data? Or add/delete it?

There are no functions in KEXI to achieve this. Advanced users can use a workaround explained in this message. The idea is to copy the data outside of the table, alter the table design, what empties it, and then import the data back to the altered table.

How to use the LIKE operator?

The KEXI's Visual Query Designer does not currently accept LIKE expressions such as 'abc%'. The query SQL View can be used as a workaround. Enter SQL condition such as SELECT owner FROM cars WHERE cars.model LIKE 'Ford%'. This message provides more information.

How to open or create a new object or print data in KEXI automatically after opening the project?

KEXI may be asked to open a table/query/form, create a new object or print data automatically after opening the database. To do so, you can add command line options when you run KEXI. Please read the "Options related to opening objects" section of the Command Line Options documentation. You can provide a desktop shortcut that is convenient for your users, containing appropriate options. For example a shortcut can have made executing kexi --open query:myquery mydb.kexi command for automatic display of myquery query. This approach is possible with any operating system. Arbitrary number of such "auto-opening" options can be specified.

Common Mistakes to Avoid

I am getting a "Could not find database driver..." error while creating a blank database file

The SQLite library required by KEXI is typically installed automatically along with KEXI when you use your operating system's package manager.

If you compiled KEXI manually, it’s likely that the installation was not completed properly. To fix this, run the following command from the KEXI build directory: make install. This command will copy and install all the necessary libraries and configuration files. Ensure you have the required permissions (e.g., use sudo if needed) when running the command.

How can I save my data? I entered some data into my table and noticed that the 'Save' menu item is grayed out.

It’s important to understand that KEXI is not document-driven. Once you open a project file (or connect to a database), every change is saved automatically, often immediately after accepting row edits or even after editing a single cell. This ensures your data is preserved without requiring manual saves.

I created a KEXI project on my server (MySQL or PostgreSQL) but could not connect and open it. I got an error 'Invalid database contents. "kexidb_major_ver" database property not found'

This issue is likely related to user privileges on the database server.

When creating a new database, you need the appropriate privileges, including the ability to create new tables. Even an empty KEXI project contains several "system" tables. Therefore, sufficient privileges are required when connecting to the server so that KEXI can create these tables.

Currently, KEXI does not provide tools to manage user privileges. You will need to use administration tools specific to your database server, such as MySQL Admin or similar software. Note that you are responsible for maintaining security when assigning privileges.

Future versions of KEXI may include administrative tools to assist with managing user privileges.

I am trying to connect to an existing (MySQL) database on my server and got this message: 'Could not open project "testdb". Invalid database contents. "kexidb_major_ver" database property not found'

(Used command: kexi --drv mysql --host mysrv -u myname testdb)

The Invalid database contents message indicates that your database is not KEXI-compatible. This likely means the database was created outside of KEXI and therefore does not contain the KEXI-specific "system" tables required for metadata and other information.

To reuse your data and database schema, consider using the KEXI Migration Tools available under KEXI Menu → Import, Export or Send → Import Database.

Please note that KEXI may not fully handle every custom MySQL feature, as KEXI is not a database frontend or admin tool. Instead, it is designed to utilize database engines for efficient and safe data storage. For administering native (non-KEXI) databases, you should use specialized tools like MySQL Workbench or pgAdmin.

See also question 4.3 for further details.

File Formats

Which is KEXI's native file format?

KEXI's native file format is based on the standard SQLite database binary file, with a .kexi extension.

Any extensions made to this file are implemented through special "system" tables stored within the database. These tables have names that start with "kexi__" and are not visible within KEXI.

What is the difference when I use a database server instead of a .kexi file for my project?

The main differences lie in multiuser access, security, and database size. While SQLite can handle large datasets, using a database server often provides better scalability and concurrent user support.

When using a server, your data and design are stored on the server in the format defined by the database software. However, from your perspective, KEXI's graphical user interface remains the same regardless of the storage medium you use. This consistency is one of KEXI's strong points.

Why isn't KEXI's native format XML-based?

KEXI is project-driven, not document-driven. Using XML for storage would significantly decrease database performance.

However, exporting table or query data in XML format is possible to implement. Additionally, you can always store XML as text within table cells if needed.

Database Support & Data Migration

Is reading/writing of Microsoft Access .mdb/.mde files available? If so, how feature-rich is this feature?

Currently, KEXI supports importing table schemas and data from .mdb/.mde files using the built-in import driver. MS Access data types are carefully mapped to KEXI data types. However, importing queries, forms, reports, and web pages is not yet supported.

For details about supported MS Access versions, see [1].

Why does KEXI not display tables created outside its interface?

For example, if you use pysqlite to create a table in a SQLite database, KEXI may open the database but will not display the externally created table.

To view external tables in KEXI, you need to use its importing functions. During the import process, KEXI automatically detects externally created tables and offers to import them with their data.

In the future, KEXI plans to allow displaying external tables without "importing" them by introducing a "linking" feature. This feature would provide limited functionality for such tables but would enable connections to existing, potentially large, databases. This integration would be particularly useful for advanced users with specific requirements.

As a temporary workaround, if you want to avoid repeatedly importing your external database:

  1. Create a new database in KEXI with the same table schemas as the original database by importing the database structure without importing the data.
  2. Dump the kexi__** "system" tables' definitions and contents into a .sql script file.
  3. Execute the .sql script file in the original database.

After completing these steps, KEXI should be able to connect to the original database and display your tables. Note that this workaround requires write privileges in the original database for step #3.


Scripting

TODO

Development

TODO

Contributions

TODO