
wxSQLite3
wxSQLite3 ist eine C++ Klasse für die Verwendung der frei verfügbaren SQLite 3.x Datenbank in wxWidgets-Anwendungen.
is the latest version. The API documentation is available online. The component itself is hosted on GitHub:
wxSQLite3 - SQLite3 database wrapper for wxWidgets (including SQLite3 encryption extension)
Description
There are already many different solutions for accessing SQLite databases. The development of the wxSQLite3 component was initially influenced primarily by the following SQLite interfaces:
- wxSQLite : This is a wxWidgets class for SQLite version 2.x. SQLite version 3.x has a number of additional features that are not supported by this class.
- CppSQLite : This class was not developed specifically for wxWidgets, so string conversions are missing, for example, but at least the newer features of SQLite version 3.x are supported.
- wxDatabase: This wxWidgets class is the successor to the databaselayer component, a database abstraction that transparently supports SQLite3, PostGreSQL, and MySQL/MariaDB databases.
wxSQLite3 does not attempt to hide the underlying database API, but instead supports almost all of the special features of SQLite version 3.x, such as the provision of user-defined scalar or aggregate functions.
Since SQLite stores strings in UTF-8 encoding, the wxSQLite3 methods automatically convert between wxString strings and UTF-8 strings. This works best for the Unicode version of wxWidgets.
The wxSQLite3 documentation generated with Doxygen is available online. Alternatively, it can be downloaded from the corresponding GitHub-Branch.
Encryption
Starting with wxSQLite3 version 4.0.0, the encryption component has been modified so that the encryption method can be selected at runtime. The following methods are currently supported:
- AES 128 Bit CBC - Without HMAC (wxSQLite3, Default encryption until version 3.5.9)
- AES 256 Bit CBC - Without HMAC (wxSQLite3)
- ChaCha20 - Poly1305 HMAC (sqleet, new default encryption for wxSQLite3)
- AES 256 Bit CBC - SHA1/SHA256/SHA512 HMAC (SQLCipher, versions 1, 2, 3 und 4)
- RC4 - Without HMAC (System.Data.SQLite) [since version 4.6.0]
- Ascon 128 - Ascon Tag (Ascon) [since version 4.9.8]
- AEGIS - AEGIS Tag (AEGIS) [since version 4.10.0]
Starting with wxSQLite3 version 3.1.0, the wxSQLite3 encryption methods AES-128-bit and AES-256-bit have been modified to fix a potential problem with the creation of unusable encrypted databases.
The probability that users of earlier versions of the encryption component will be affected by the problem is relatively low, at most 1 in 8192, i.e., less than 0.02%. Nevertheless, it was decided to fix this weakness in the implementation.
From now on, bytes 16 to 23 of the database header will be stored unencrypted (as is also the case in the paid encryption component SEE (SQLite Encryption Extension) from the SQLite developers). This is important because these bytes are read and interpreted in the SQLite code before any encryption component has a chance to decrypt the database header.
The good news for users of earlier versions of the wxSQLite3 encryption component is that the new version transparently converts existing encrypted databases to the new format. However, this only works in one direction, i.e., once a database file has been converted to the new format, it can no longer be processed by earlier versions of the encryption component. Instead, you will receive the error message “No database or encrypted.”
Notes
Due to a change in the SQLite source code on February 7, 2020 (“Simplify the code by removing the unsupported and undocumented SQLITE_HAS_CODEC compile-time option”), it is no longer possible to maintain the previous implementation of the encryption extension with reasonable effort. The separate GitHub project SQLite3 Multiple Ciphers provides a new implementation of the encryption extension that is compatible with future SQLite versions. Starting with version 4.6.0, this new implementation will be used in wxSQLite3 by taking the aggregated source files from there.
The precompiled SQLite3 binaries for Windows previously provided in connection with releases will continue to be available in the future, but now as part of the SQLite3 Multiple Ciphers project.
History
A detailed version history can be found in the change log.