wxSQLite3  5.0.1
Loading...
Searching...
No Matches

What is wxSQLite3?

wxSQLite3 is a C++ wrapper around the public domain SQLite 3.x database and is specifically designed for use in programs based on the wxWidgets library.

Several solutions exist to access SQLite databases. To name just a few:

  • wxSQLite : This is a wxWidgets wrapper for version 2.8.x of SQLite. SQLite version 3.x has a lot more features - which are not supported by this wrapper.
  • wxDatabase : This is a database abstraction providing a JDBC-like interface to database I/O. SQLite3, PostgreSQL, MySQL, and ODBC database backends are supported.
  • sqlite3pp : Not wxWidgets specific, but based on modern C++ concepts.
  • SQLiteC++ : Not wxWidgets specific, a smart and easy to use C++ SQLite3 wrapper.

The component wxSQLite3 was inspired by various SQLite wrappers, among them the ones mentioned above. wxSQLite3 does not try to hide the underlying database, in contrary almost all special features of SQLite version 3.x are supported, like for example the creation of user defined scalar or aggregate functions.

Since SQLite stores strings in UTF-8 encoding, the wxSQLite3 methods provide automatic conversion between wxStrings and UTF-8 strings. The methods ToUTF8 and FromUTF8 of the wxString class (available since wxWidgets 2.8.4) are used for the conversion. Special care has to be taken if external administration tools are used to modify the database contents, since not all of these tools operate in Unicode or UTF-8 mode.

Note
With the release of SQLite version 3.32.0 on May 22, 2020 critical changes to the public SQLite code finally took officially effect, although they weren't officially announced. They were introduced on Feb 7, 2020: "Simplify the code by removing the unsupported and undocumented SQLITE_HAS_CODEC compile-time option". Since August 2020 a new implementation of an encryption extension, capable of supporting SQLite version 3.32.0 and later, is available as a separate project, SQLite3 Multiple Ciphers. Starting with the release of wxSQLite3 4.6.0 this new implementation was and is used.
Note
wxSQLite3 5.x is a major update with a modernized C++ API. It is not fully source-compatible with wxSQLite3 4.x. Therefore, wxSQLite3 4.x will receive maintenance updates, including updates to the bundled SQLite version, for a limited period following the release of 5.0.0. No new API features will be added. The End-of-Life date of version 4.x will be announced separately.
The section Migration Guide details the steps required to migrate from prior wxSQLite3 versions. The section Modern C++ Interface presents the new features.

Current Version

5.0.1 - August 2026
Enhanced template Get and Bind methods to handle integral types in general (like int8_t, uint16, enum and so on)
Enhanced template Bind methods to handle direct types instead of std::optional only
Added class attribute to enum enumerations where it was still missing
Adjusted minimal sample

For further version information please consult the CHANGELOG.

Author
Ulrich Telle (github DOT telle MINUS online DOT de)

Acknowledgments

The following people have contributed to wxSQLite3:

  • Francesco Montorsi (enhancement of the build system)
  • Neville Dastur (enhancement of the method TableExists)
  • Tobias Langner (RAII class for managing transactions)
  • Deamhan (CMake support and various bug fixes)