KDb/About KDb: Difference between revisions

From KDE Community Wiki
< KDb
No edit summary
No edit summary
Line 11: Line 11:
However, wrapping QtSQL for executing SQL statements means:
However, wrapping QtSQL for executing SQL statements means:


=== KDb and Qt SQL ===
== KDb and Qt SQL ==
KDb has a slightly different architecture and requirements than Qt SQL.  
KDb has a slightly different architecture and requirements than Qt SQL.  



Revision as of 00:00, 27 August 2023

KDb is a database connectivity and creation framework for various database vendors.

KDb is consisted of a general-purpose C++/Qt-only library and a set of plugins. Because there is no dependency on Kexi, Calligra or even on KDE libraries, KDb is developed for a wider audience. Kexi since the version 3 uses it too, thus deprecating KexiDB.

KDb is widely free/libre software available under the GNU Lesser General Public License (LGPL). Thus, developers are free to:

  • use KDb in applications, also commercial
  • extend it for specialized use cases
  • contribute directly to KDb
If you really want, QtSQL drivers can be wrapped to be KexiDB compatible.

However, wrapping QtSQL for executing SQL statements means:

KDb and Qt SQL

KDb has a slightly different architecture and requirements than Qt SQL.

Unlike QtSQL, KDb 'knows' how to create database and new tables and it has a public C++ API for that. You do not need to pass raw SQL statements to KDb at all in order to use this feature. But passing the SQL statepents is possible if this is what you wish. KDb is event able to parse the statements before contacting the database.

KDb is developed as a a data/database handling layer for KEXI and similarly complex apps.

In turn, Qt SQL has poorer error handling. For example, it is often problematic with Qt SQL to recognize whether the connection failed because the database does not exist or because the password was wrong. Qt SQL error values aren't sufficiently rich to provide such information. Developer sometimes try to parse the error messages, what makes the application code complex and hard to maintain.

History

KDb is a new iteration of a connectivity library developed since 2003. It was previously known as KexiDB. The development happens within the Kexi application project. Even if KDb's release schedule is synchronized with KEXI's schedule at the moment, there is no technical dependency on KEXI.