Coder Social home page Coder Social logo

utelle / wxsqlite3 Goto Github PK

View Code? Open in Web Editor NEW
567.0 53.0 173.0 69.68 MB

wxSQLite3 - SQLite3 database wrapper for wxWidgets (including SQLite3 encryption extension)

Home Page: http://utelle.github.io/wxsqlite3

License: Other

Makefile 0.96% Shell 2.66% C++ 2.59% C 93.07% Lua 0.22% M4 0.37% CMake 0.12% Batchfile 0.01%
sqlite-amalgamation wxsqlite3 encryption-extension sqlite3 sqlite3-encryption database-encryption encrypted-database encryption-support database-adapter sqlite-database

wxsqlite3's Introduction

wxSQLite3 - a lightweight wrapper for SQLite

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.

wxSQLite3 does not try to hide the underlying database, in contrary almost all special features of the current SQLite3 version 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. This works best for the Unicode builds of wxWidgets. In ANSI builds the current locale conversion object (wxConvCurrent) is used for conversion to/from UTF-8. 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.

Since version 1.7.0 wxSQLite3 includes a key-based SQLite3 encryption extension using AES encryption. The decision whether to use 128 bit or 256 bit AES encryption had to be made at compile time. Starting with version 4.0.0 the encryption extension allows to select the cipher scheme at runtime.

Currently the following encryption schemes are supported:

Important Notes

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". As a consequence, updating the wxSQLite3 encryption extension to support SQLite version 3.32.0 and later was no longer possible.

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 is used.

Table of Contents

Version history

  • 4.9.10 - March 2024
    • Upgrade to SQLite3 Multiple Ciphers version 1.8.4 (SQLite version 3.45.2)
    • Disable user authentication extension in build files by default
  • 4.9.9 - January 2024
    • Upgrade to SQLite3 Multiple Ciphers version 1.8.2 (SQLite version 3.45.0)
  • 4.9.8 - November 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.8.0 (SQLite version 3.44.1)
    • Added new cipher scheme Ascon-128 (Lightweight Authenticated Encryption)
  • 4.9.7 - November 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.7.4 (SQLite version 3.44.0)
    • Prevent crashes due to uninitialized cipher tables (issue #113)
  • 4.9.6 - October 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.7.0 (SQLite version 3.43.1)
  • 4.9.5 - September 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.6.5 (SQLite version 3.43.1)
  • 4.9.4 - May 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.6.3 (SQLite version 3.42.0)
  • 4.9.3 - March 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.6.1 (SQLite version 3.41.1)
  • 4.9.2 - February 2023
    • Upgrade to SQLite3 Multiple Ciphers version 1.6.0 (SQLite version 3.41.0)
    • Enhanced method wxSQLite3Database::Open allowing to set the VFS to be used
    • Added method wxSQLite3Database::IsInterrupted
  • 4.9.1 - November 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.5.4 (SQLite version 3.40.0)
  • 4.9.0 - September 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.5.3 (SQLite version 3.39.3)
  • 4.8.2 - July 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.4.6 (SQLite version 3.39.1)
  • 4.8.1 - May 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.4.3 (SQLite version 3.38.5)
  • 4.8.0 - April 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.4.2 (SQLite version 3.38.3)
  • 4.7.9 - April 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.10 (SQLite version 3.38.2)
  • 4.7.8 - March 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.9 (SQLite version 3.38.1)
  • 4.7.7 - February 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.8 (SQLite version 3.38.0)
  • 4.7.6 - January 2022
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.7 (SQLite version 3.37.2)
  • 4.7.5 - November 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.5 (SQLite version 3.37.0)
    • Added build support for Visual C++ 2022
  • 4.7.4 - July 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.4 (SQLite version 3.36.0)
  • 4.7.3 - June 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.3 (SQLite version 3.36.0)
  • 4.7.2 - May 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.2 (SQLite version 3.35.5)
  • 4.7.1 - April 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.1 (SQLite version 3.35.5)
  • 4.7.0 - April 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.3.0 (SQLite version 3.35.5)
  • 4.6.10 - April 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.5 (SQLite version 3.35.5)
  • 4.6.9 - April 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.4 (SQLite version 3.35.4)
  • 4.6.8 - March 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.3 (SQLite version 3.35.3)
  • 4.6.7 - March 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.2 (SQLite version 3.35.2)
  • 4.6.6 - March 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.1 (SQLite version 3.35.1)
  • 4.6.5 - March 2021
    • Upgrade to SQLite3 Multiple Ciphers version 1.2.0 (SQLite version 3.35.0)
    • Enabled new SQLite Math Extension
    • Fixed a memory leak in method wxSQLite3Database::GetTable
    • Adjusted build files (DLL builds with MinGW/GCC used wrong DLL file extension)
  • 4.6.4 - December 2020
    • Upgrade to SQLite3 Multiple Ciphers version 1.1.3
    • Adjusted autotool build files to enable AES hardware support if available
  • 4.6.3 - December 2020
    • Upgrade to SQLite3 Multiple Ciphers version 1.1.2
    • Adjusted build files for MinGW
  • 4.6.2 - December 2020
    • Upgrade to SQLite3 Multiple Ciphers version 1.1.1
    • Upgrade to SQLite version 3.34.0
    • Added method wxSQLite3Database::QueryTransactionState
  • 4.6.1 - October 2020
    • Added SQLite VSV extension (Variably Separated Values)
  • 4.6.0 - August 2020
    • Use SQLite encryption extension SQLite3 Multiple Ciphers
    • Upgrade to SQLite version 3.33.0
    • Added support for System.Data.SQLite's RC4 encryption
  • 4.5.1 - January 2020
    • Upgrade to SQLite version 3.31.1
  • 4.5.0 - January 2020
    • Upgrade to SQLite version 3.31.0
    • Modified API for wxSQLite3Database::CreateFunction methods
  • 4.4.8 - October 2019
    • Upgrade to SQLite version 3.30.1
    • Adjusted encryption extension to support SQLite's shared cache mode
  • 4.4.7 - October 2019
    • Upgrade to SQLite version 3.30.0
  • 4.4.6 - September 2019
    • Fixed missing cipher application in method wxSQLite3Database::ReKey
  • 4.4.5 - August 2019
    • Fixed broken compatibility with wxWidgets 2.8.12
  • 4.4.4 - August 2019
    • Upgrade to SQLite version 3.29.0
    • Added SQLite logging support
    • Added build support for VS2019
    • Added CMake support (PR #63)
    • Updated build files to overcome problems with static builds (issue #73)
    • Eliminated duplication of error messages for different wxWidgets builds (PR #64)
    • Fixed missing call to progress callback in wxSQLite3Database::Restore (PR #66)
    • Fixed issue #58 with silently failing wxSQLite3Transaction::Commit method
    • Fixed issue with named collections which could result in crashes (PR #59)
  • 4.4.3 - May 2019
    • Upgrade to SQLite version 3.28.0
  • 4.4.2 - February 2019
    • Upgrade to SQLite version 3.27.2
  • 4.4.1 - February 2019
    • Upgrade to SQLite version 3.27.1
  • 4.4.0 - December 2018
    • Upgrade to SQLite version 3.26.0
    • Added support for the SQLCipher 4 database format
  • 4.3.0 - November 2018
    • Upgrade to SQLite version 3.25.3
    • Adjusted encryption extension to support cipher configuration via database URI
  • 4.2.0 - October 2018
    • Added method wxSQLite3Database::GetKeySalt to access the key salt of encrypted databases
    • Fixed memory leaks in methods wxSQLite3ResultSet::GetExpandedSQL and wxSQLite3Statement::GetExpandedSQL
    • Adjusted encryption extension to support raw key (and salt) for the ChaCha20 (sqleet) encryption scheme
  • 4.1.1 - October 2018
    • Upgrade to SQLite version 3.25.2
  • 4.1.0 - September 2018
    • Upgrade to SQLite version 3.25.1
    • Added support for SQL window functions
    • Adjusted encryption extension to check for matching page sizes on rekeying a database
  • 4.0.4 - June 2018
    • Upgrade to SQLite version 3.24.0
  • 4.0.3 - April 2018
    • Adjusted encryption extension to better support the SQLite backup API
  • 4.0.2 - April 2018
    • Upgrade to SQLite version 3.23.1
  • 4.0.1 - April 2018
    • Fixed a bug in the rekeying function of the encryption extension
  • 4.0.0 - April 2018
    • Added multi-cipher support
    • Added methods for attaching/detaching databases
    • Cleaned up code using statement buffers
  • 3.5.9 - January 2018
    • Upgrade to SQLite version 3.22.0
  • 3.5.8 - November 2017
    • Upgrade to SQLite version 3.21.0
  • 3.5.7 - September 2017
    • Upgrade to SQLite version 3.20.1
  • 3.5.6 - August 2017
    • Upgrade to SQLite version 3.20.0
    • Added support for persistent prepared statements
    • Added support for binding pointers (new SQLite pointer-binding interface)
    • Added several SQLite extensions (csv, sha3, carray, fileio, series) for the included SQLite library
    • Modified build files to expose the parameter SQLITE_MAX_ATTACHED to allow easier adjustment of the maximum number of attached databases
  • 3.5.5 - June 2017
    • Upgrade to SQLite version 3.19.3
  • 3.5.4 - June 2017
    • Upgrade to SQLite version 3.19.2
  • 3.5.3 - March 2017
    • Upgrade to SQLite version 3.18.0
    • Minor modification to wxsqlite3.pc.in to fix issue with pkgconfig tool
  • 3.5.2 - March 2017
    • Upgrade to SQLite version 3.17.0
    • Fixed minor issue in SQLite encryption extension related to symbol SQLITE_DEBUG
    • Modified build system for GNU make (support monolithic wxWidgets build)
  • 3.5.1 - February 2017
    • Added version information as Windows resource for DLL builds on Windows
    • Cleaned up premake5 build files for Visual C++ (corrected debug environment settings)
    • Resolved wxWidgets library dependencies for Visual C++ using wxWidgets' special setup.h for MSVC
  • 3.5.0 - January 2017
    • Upgrade to SQLite version 3.16.2
    • SQLite3 library now integrated part of wxSQLite3
    • Overhaul of build system
  • 3.4.1 - October 2016
    • Upgrade to SQLite version 3.15.0
  • 3.4.0 - August 2016
    • Upgrade to SQLite version 3.14.1
    • Added method wxSQLite3Statement::GetExpandedSQL
    • Added method wxSQLite3ResultSet::GetExpandedSQL
    • Started to modify the build system to compile and statically link the SQLite3 library together with wxSQLite3
    • Added the CSV extension module as part of the SQLite3 library with encryption extension
  • 3.3.1 - April 2016
    • Upgrade to SQLite version 3.12.1
    • Added method wxSQLite3Database::GetSystemErrorCode
  • 3.3.0 - December 2015
    • Upgrade to SQLite version 3.9.2 (including adjusted SQLite amalgamation source to fix problem with the user authentication module)
    • Transition from SourceForge to GitHub
  • 3.2.1 - March 2015
    • Upgrade to SQLite version 3.8.8.3
    • Fixed a bug in method GetParamName
  • 3.2.0 - December 2014
    • Upgrade to SQLite version 3.8.7.4
    • Added support for the SQLite user authentication module
  • 3.1.1 - June 2014
    • Upgrade to SQLite version 3.8.5
  • 3.1.0 - May 2014
    • Upgrade to SQLite version 3.8.4.3
    • Added flag isDeterministic to method wxSQLite3Database::CreateFunction
    • Added new GUI sample
    • Changed implementation of encryption extension (see readme file in sqlite3 subfolder)
  • 3.0.6 - December 2013
    • Upgrade to SQLite version 3.8.2
  • 3.0.5 - September 2013
    • Upgrade to SQLite version 3.8.0.2
    • Added support for setting the temporary directory for SQLite on Windows
  • 3.0.4 - August 2013
    • Upgrade to SQLite version 3.8.0
    • Added support for querying performance characteristics of prepared statements
  • 3.0.3 - March 2013
    • Upgrade to SQLite version 3.7.16
  • 3.0.2 - Dezember 2012
    • Upgrade to SQLite version 3.7.15.1
    • Corrected an internal SQLite data structure to avoid compile time warnings
    • Changed method wxSQLite3Exception::ErrorCodeAsString to return the error messages provided by SQLite
  • 3.0.1 - November 2012
    • Upgrade to SQLite version 3.7.14.1
    • Cleaned up and optimized Finalize methods
    • Modified wxSQLite3Database::Close to avoid potential memory leaks
    • Added method wxSQLite3Database::GetWrapperVersion
    • Added method wxSQLite3Database::IsReadOnly
    • Added method wxSQLite3Statement::BindUnixDateTime
    • Added method wxSQLite3ResultSet::GetUnixDateTime
    • Added method wxSQLite3ResultSet::GetAutomaticDateTime
    • Fixed a potential memory leak in method wxSQLite3Database::ExecuteUpdate
    • Added a wxsqlite3.pc file on request of the Fedora Project developers
    • Replaced assert by wxASSERT in wxSQLite3Transaction constructor
  • 3.0.0 - January 2012
    • Upgrade to SQLite version 3.7.10
    • Added method wxSQLite3Database::Vacuum
    • Added method wxSQLite3Database::GetDatabaseFilename
    • Added method wxSQLite3Database::ReleaseMemory
    • Added method wxSQLite3ResultSet::CursorMoved
    • Added method wxSQLite3Statement::IsBusy
    • Fixed a bug in method operator= of wxSQLite3StringCollection causing an endless recursion on assignment
    • Dropped the concept of SQLite3 pointer ownership in favor of reference counted pointers allowing much more flexible use of wxSQLite3 classes
    • Modified SQLite3 encryption extension (defining int64 datatype for SHA2 algorithm)
    • Dropped dbadmin sample from build files
    • Added Premake support for SQLite3 library with encryption support and for wxSQLite3 (experimental)
  • 2.1.3 - August 2011
    • Corrected default behaviour for attached databases in case of an encrypted main database. (Now the attached database uses the same encryption key as the main database if no explicit key is given. Previously the attached database remained unencrypted.)
    • Added an optional progress callback for metheods Backup & Restore
    • Added method SetBackupRestorePageCount to set the number of pages to be copied in one cycle of the backup/restore process
  • 2.1.2 - July 2011
    • Upgrade to SQLite version 3.7.7.1
    • Modified wxSQLite3Transaction class to make it exception safe
  • 2.1.1 - April 2011
    • Upgrade to SQLite version 3.7.6.1
    • Added convenience method wxSQLite3Statement::ExecuteScalar
    • Changed write-ahead log checkpoint method to new version (v2)
  • 2.1.0 - March 2011
    • Upgrade to SQLite version 3.7.5
    • Added wxSQLite+, a database administration application written by Fred Cailleau-Lepetit, as a GUI sample for wxSQLite3. Minor adjustments were applied to make wxSQLite+ compatible with wxWidgets 2.9.x. To compile and link wxSQLite+ successfully using wxWidgets 2.8.x it is required to build the "stc" library (scintilla) in the "contrib" folder of wxWidgets. Please note that wxSQLite+ is under GPL license.
  • 2.0.2 - December 2010
    • Upgrade to SQLite version 3.7.4
  • 2.0.1 - October 2010
    • Upgrade to SQLite version 3.7.3
    • Added parameter transferStatementOwnership to method wxSQLite3Statement::ExecuteQuery to allow using the returned result set beyond the life time of the wxSQLite3Statement instance
  • 2.0.0.1 - August 2010
    • Upgrade to SQLite version 3.7.0.1
    • Added missing function interfaces in wxsqlite3dyn.h
    • Adjusted code to eliminate a reference to sqlite3_mprintf
  • 2.0.0 - July 2010
    • Upgrade to SQLite version 3.7.0
    • Fixed a bug in class wxSQLite3ResultSet
    • Added support for SQLite's write-ahead log journal mode
    • Added support for named collections (see class wxSQLite3NamedCollection)
    • Changed UTF-8 string handling to use methods To/FromUTF8 of the wxString class (requires wxWidgets 2.8.4 or higher)
    • Compatible with wxWidgets 2.9.1
  • 1.9.9 - March 2010
    • Upgrade to SQLite version 3.6.23
    • Fixed a bug when compiling for dynamic loading of SQLite
    • Added static methods to class wxSQLite3Database for accessing the run-time library compilation options diagnostics
    • Added mathod FormatV to class wxSQLite3StatementBuffer
  • 1.9.8 - February 2010
    • Upgrade to SQLite version 3.6.22
    • Fixed a bug when compiling without precompiled header support (by including wx/arrstr.h)
    • Added experimental support for 256 bit AES encryption to the optional key based encryption extension
  • 1.9.7 - November 2009
    • Upgrade to SQLite version 3.6.20
    • Added methods to query, enable or disable foreign key support
  • 1.9.6 - September 2009
    • Upgrade to SQLite version 3.6.18
    • Added method to get the SQLite library source id
    • Added flags parameter to wxSQLite3Database::Open to allow additional control over the database connection (see http://www.sqlite.org/c3ref/open.html for further information)
    • Fixed a potential memory leak in wxSQLite3Statement class
    • Converted encryption extension from C++ to pure C to make it compatible with the SQLite amalgamation.
  • 1.9.5 - February 2009
    • Upgrade to SQLite version 3.6.11
    • Added user defined function class for REGEXP operator
    • Added support for SQLite backup/restore API, introduced with SQLite 3.6.11
  • 1.9.4 - January 2009
    • Upgrade to SQLite version 3.6.10
    • Added support for SQLite savepoints, introduced with SQLite 3.6.8
    • Added IsOk methods to several classes
  • 1.9.3 - Dezember 2008
    • Upgrade to SQLite version 3.6.7
    • Fixed a bug in method wxSQLite3Table::GetDouble (conversion from string to double failed in non-US locales)
    • Build system upgraded using Bakefile 0.2.5
  • 1.9.2 - November 2008
    • Upgrade to SQLite version 3.6.6
    • Added RAII transaction class (see docs for details)
  • 1.9.1 - September 2008
    • Upgrade to SQLite version 3.6.2
    • Introduced own step counting for aggregate user functions since the sqlite3_aggregate_count function is now deprecated.
    • Enhanced wxSQLite3Database::TableExists method to query an attached database for existence of a table or to query all open databases.
  • 1.9.0 - July 2008
    • Upgrade to SQLite version 3.6.0
    • The optional key based encryption support has been adapted to support SQLite version 3.6.0.
    • Added static methods to initialize and shutdown the SQLite library.
    • Changed build system to support static library build against shared wxWidgets build on Linux.
    • Changed behaviour of Close method of class wxSQLite3Database to finalize all unfinalized prepared statements.
  • 1.8.5 - June 2008
    • Upgrade to SQLite version 3.5.9
    • Integration of the optional key based encryption support into SQLite has been made easier. Changes to original SQLite source files are no longer necessary.
  • 1.8.4 - April 2008
    • Upgrade to SQLite version 3.5.8
    • Added support for accessing database limits
    • Changed method TableExists to check a table name case insensitive
    • Fixed several minor issues in the build files.
  • 1.8.3 - January 2008
    • Added support for shared cache mode
    • Added support for access to original SQL statement for prepared statements (requires SQLite 3.5.3 or above)
    • Fixed broken SQLite DLLs
  • 1.8.2 - Dezember 2007
    • Upgrade to SQLite version 3.5.4
    • Fixed a bug in in wxSQLite3Database::Begin (wrong transaction type)
  • 1.8.1 - November 2007
    • Fixed a bug in in wxSQLite3Database::Close (resetting flag m_isEncrypted)
    • Eliminated several compile time warnings (regarding unused parameters)
    • Fixed a compile time bug in wxSQLite3Database::GetBlob (missing explicit type cast)
  • 1.8.0 - November 2007
    • Upgrade to SQLite version 3.5.2
    • Support for SQLite incremental BLOBs
    • Changed source code in the SQLite3 encryption extension to eliminate several warnings
    • Changed default wxWidgets version to 2.8.x
    • Adjusted sources for SQLite encryption support are included for all SQLite version from 3.3.1 up to 3.5.2
    • SQLite link libraries for MinGW on Windows are included
    • Added WXMAKINGLIB_WXSQLITE3 compile time option to support building wxSQLite3 as a static library while using the shared libraries of wxWidgets.
  • 1.7.3 - May 2007
    • Upgrade to SQLite version 3.3.17
    • Fixed a bug in the SQLite3 encryption extension (MD5 algorithm was not aware of endianess on big-endian platforms, resulting in non-portable database files)
  • 1.7.2 - February 2007
    • Upgrade to SQLite version 3.3.11
    • Support for loadable extensions is now optional
    • Check for optional wxSQLite3 features at runtime
    • wxSQLite3 API independent of optional features
  • 1.7.1 - January 2007
    • Fixed a bug in the key based database encryption feature (The call to sqlite3_rekey in wxSQLite3Database::ReKey could cause a program crash, when used to encrypt a previously unencrypted database.)
  • 1.7.0 - January 2007
    • Upgrade to SQLite version 3.3.10
    • Added support for BLOBs as wxMemoryBuffer objects
    • Added support for loadable extensions
    • Optional support for key based database encryption
  • 1.6.0 - July 2006
    • Added support for user-defined collation sequences
  • 1.5.3 - June 2006
    • Upgrade to SQLite version 3.3.6
    • Added support for optional SQLite meta data methods
  • 1.5.2 - March 2006
    • Fixed a bug in wxSQLite3Database::Prepare
    • Added wxSQLite3Database::IsOpen for convenience
  • 1.5.1 - February 2006
    • SQLite DLL upgraded to version 3.3.4
  • 1.5 - February 2006
    • Upgrade to SQLite version 3.3.3
    • Added support for commit, rollback and update callbacks
  • 1.4.2 - November 2005
    • Optimized code for wxString arguments
  • 1.4.1 - November 2005
    • Fixed a bug in TableExists, eliminated some compiler warnings
    • Changed handling of Unicode string conversion
    • Added support for different transaction types
  • 1.4 - November 2005
    • Optionally load SQLite library dynamically at run time
  • 1.3.1 - November 2005
    • Corrected wxSQLite3ResultSet::GetInt64,
    • Added wxSQLite3Table::GetInt64
  • 1.3 - October 2005
    • Added wxGTK build support
  • 1.2 - October 2005
    • Corrected error in wxSQLite3Table::FindColumnIndex
  • 1.1 - October 2005
    • Upgrade to SQLite version 3.2.7
  • 1.0 - July 2005
    • First public release

The build files for Windows platforms are now generated with Premake 5 (version Premake 5.0 alpha 15).

Ready to use project files are provided for Visual C++ 2010, 2012, 2013, 2015, 2017, and 2019. Additionally, GNU Makefiles are provided supporting for example MinGW-w64.

For Visual Studio 2010+ solutions it is possible to customize the build by creating a wx_local.props file in the build directory which is used, if it exists, by the projects. The settings in that file override the default values for the properties. The typical way to make the file is to copy wx_setup.props to wx_local.props and then edit locally.

For GNU Makefiles the file config.gcc serves the same purpose as the file wx_setup.props for Visual C++ projects.

The customization files wx_setup.props resp. config.gcc allow to customize certain settings like for example the version number and the root directory of the wxWidgets library.

wxMSW

When building on Win32 or Win64, you can use the makefiles or one of the Microsoft Visual Studio solution files in the build folder.

The Visual Studio solution files reference the property file wx_setup.props in the build subdirectory. This file is configured in a way to allow running AppVeyor CI without any modifications. Especially, specific library directories are used for different compiler versions (as it is used by the pre-built wxWidgets libraries) by adding the toolkit version (i.e., 141 for VS 2015, 142 for VS 2019) to the library path name.

To get library path names without toolkit version (as you usually get when compiling wxWidgets yourself) please adjust the 2 parameters wxCompilerPrefix and wxMsvcVersionAuto in file wx_setup.props as follows:

<wxCompilerPrefix>vc</wxCompilerPrefix>
<wxMsvcVersionAuto></wxMsvcVersionAuto>

Additionally, the property file assumes that the environment variable WXWIN is defined and points to the root directory of the wxWidgets installation. Make sure that WXWIN is set up properly, or replace it by a environment variable of your choice or by an absolute path specification.

For Visual C++ the debugging properties are set up in such a way that debugging the sample applications should work right out of the box. For release builds you may need to copy the wxSQLite3 DLL or add the lib folder path to the Windows search path (PATH environment variable).

The SQLite3 library is now compiled as an integrated part of wxSQLite3. The advantage is that SQLite3 and wxSQLite3 are always compiled with matching configuration options. Additionally, the SQLite3 encryption extension is automatically enabled, too.

A precompiled SQLite shell program supporting encrypted databases is provided as a separate download. Use

PRAGMA KEY="encryption key";

to create or open an encrypted database. Use

ATTACH DATABASE x AS y KEY z;

to attach an encrypted database.

wxGTK

When building on an autoconf-based system (like Linux/GNU-based systems), the first setup is to recreate the configure script doing:

  autoreconf

Thereafter you should create a build directory

  mkdir build-gtk [or any other suitable name]
  cd build-gtk
  ../configure [here you should use the same flags you used to configure wxWidgets]
  make

Type ../configure --help for more info.

The autoconf-based system also supports a make install target which builds the library and then copies the headers of the component to /usr/local/include and the lib to /usr/local/lib.

SQLite has many optional features and offers a number of optional extensions. The below table lists the features that are enabled for wxSQLite3 as default. For details, please see SQLite Compile Time Options.

In case of memory constraints it is of course possible to disable unneeded features. However, this will usually require to modify the build files.

Symbol Description
SQLITE_DQS Setting for the double-quoted string literal misfeature (default: disabled)
SQLITE_ENABLE_CARRAY C array extension
SQLITE_ENABLE_COLUMN_METADATA Access to meta-data about tables and queries
SQLITE_ENABLE_CSV CSV extension
SQLITE_ENABLE_DEBUG Enable additional debug features (default: off)
SQLITE_ENABLE_DESERIALIZE Option to enable the serialization interface
SQLITE_ENABLE_EXPLAIN_COMMENTS Enable additional comments in EXPLAIN output
SQLITE_ENABLE_FTS3 Version 3 of the full-text search engine
SQLITE_ENABLE_FTS3_PARENTHESIS Additional operators for query pattern parser
SQLITE_ENABLE_FTS4 Version 4 of the full-text search engine
SQLITE_ENABLE_FTS5 Version 5 of the full-text search engine
SQLITE_ENABLE_GEOPOLY Geopoly extension
SQLITE_ENABLE_JSON1 JSON SQL functions
SQLITE_ENABLE_REGEXP Regular expression extension
SQLITE_ENABLE_RTREE R*Tree index extension
SQLITE_ENABLE_EXTFUNC Extension with mathematical and string functions
SQLITE_ENABLE_FILEIO Extension with file I/O SQL functions
SQLITE_ENABLE_SERIES Series extension
SQLITE_ENABLE_SHA3 SHA3 extension
SQLITE_ENABLE_UUID Extension for handling handling RFC-4122 UUIDs
SQLITE_MAX_ATTACHED=10 Maximum Number Of Attached Databases (max. 125)
SQLITE_SECURE_DELETE Overwrite deleted content with zeros
SQLITE_SOUNDEX Enable soundex SQL function
SQLITE_THREADSAFE Setting the multithreading mode (default: serialized)
SQLITE_USE_URI Enable URI file names
SQLITE_USER_AUTHENTICATION User authentication extension

The public release of SQLite contains hooks for key based database encryption, but the code for implementing this feature is not freely available. D. Richard Hipp offers a commercial solution (see http://www.hwaci.com/sw/sqlite/prosupport.html#crypto).

There exist other closed-source commercial solutions, among them:

Both use a slightly different encryption API, which is currently NOT supported by wxSQLite3.

For Windows based systems there exists an open source solution: System.Data.SQLite. For SQLite version 3.32.0 or higher encryption support has been dropped. However, the new encryption extension SQLite3 Multiple Ciphers allows to use this encryption scheme on all supported platforms.

wxSQLite3 uses now the new encryption extension SQLite3 Multiple Ciphers. Precompiled binaries of the SQLite3 DLL and the SQLite3 shell for Windows are now provided by this new separate project.

Using statically linked SQLite library on Windows

Starting with wxSQLite3 version 3.5.0 the SQLite3 library is compiled as an integrated part of wxSQLite3. A separate SQLite3 DLL is not required any longer.

wxSQLite3 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 or later as published by the Free Software Foundation, with the wxWindows 3.1 exception.

The following people have contributed to wxSQLite3:

  • Vadim Zeitlin (revision of the build system)
  • Francesco Montorsi (enhancement of the build system)
  • Neville Dastur (enhancement of the method TableExists)
  • Tobias Langner (RAII class for managing transactions)

wxsqlite3's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxsqlite3's Issues

Debug mode if SQLite

What about having SQLite in debug mode?

For this sqlite3secure.c needs to be compiled with -DSQLITE_DEBUG something like

set COMMON_FLAGS=--shared -Os -I. -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DHAVE_USLEEP -DHAVE_READLINE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_HAS_CODEC=1 -DCODEC_TYPE=CODEC_TYPE_AES256 -DSQLITE_CORE -DTHREADSAFE=1 -DSQLITE_DLL=1 -DSQLITE_SECURE_DELETE -DSQLITE_SOUNDEX

gcc %COMMON_FLAGS% sqlite3secure.c -o sqlite3.dll
gcc %COMMON_FLAGS% -DSQLITE_DEBUG sqlite3secure.c -o sqlite3d.dll

and then in makefile.gcc

ifeq ($(USE_DYNAMIC_SQLITE3_LOAD),0)
	ifeq ($(WX_DEBUG),0)
		__SQLITE3_DEP_p = -lsqlite3
	endif
	ifeq ($(WX_DEBUG),1)
		__SQLITE3_DEP_p = -lsqlite3d
	endif
endif

Does it make sense?

rekey doesn't seem to work

Hi,
I'm trying to use this software to be able to us encryption for sqlite databases.
I'm trying to use database encryption with QT. I made it build already (at least the sqlite part + encryption). The wxWidgets stuff I don't really need.
So here is my problem.
Whenever I use rekey it fails to change the key.

        int rc = sqlite3_open_v2("test.sql", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);

        if( rc ){
            qInfo() << "Can't open database";
            return;
        }else{
            qInfo() << "Opened database successfully ";
        }

        string pw = "blabla";
        if (!isDbEncrypted(db))
        {
            sqlite3_key(db, "", 0);
            sqlite3_rekey(db, pw.data(), pw.length());
            qInfo() << "Database was encrypted.";
        }
        else
        {
            sqlite3_key(db, pw.data(), pw.length());
            sqlite3_rekey(db, "", 0);
            qInfo() << "Database was decrypted.";
        }

        sqlite3_close(db);

I simply open a database. If it is not encrypted it will be encrypted and if it is already encrpted it will be decrypted. At least this is how it should be but it is not. If a new unencrypted DB is created it works fine but if I load the DB again after the encrption I get an error that the DB is corrupted or encrypted e´ven though I set the correct password with sqlite3_key(...).
I don't really get it. Am I missing something?

Build failed 3.5.1 with wx 3.0.3 or wx 3.1

src/wxsqlite3.cpp: At global scope:
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
};
^
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
src/wxsqlite3.cpp:4134:1: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
In file included from /usr/include/wx-3.1/wx/debug.h:19:0,
from /usr/include/wx-3.1/wx/defs.h:693,
from /usr/include/wx-3.1/wx/wxprec.h:12,
from src/wxsqlite3.cpp:18:
src/wxsqlite3.cpp: In static member function 'static wxString wxSQLite3Database::LimitTypeToString(wxSQLite3LimitType)':
src/wxsqlite3.cpp:4140:35: error: cannot convert 'const char*' to 'const wxChar* {aka const wchar_t*}' in initialization
const wxChar* limitString = wxS("Unknown");
^
/usr/include/wx-3.1/wx/chartype.h:239:20: note: in definition of macro 'wxS'
#define wxS(x) x

includedir cannot be controlled properly

This is because bakefile (the build system) is a horrible mess. And makes random assumptions about what I want.

But we need that because otherwise the pkgconfig file line https://github.com/utelle/wxsqlite3/blob/master/wxsqlite3.pc.in#L5 doesn't work anyway.

E.g. in that codeblock it does

@COND_SHARED_0@install_wxsqlite3_lib_headers: 
@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(prefix)
@COND_SHARED_0@ for f in $(WXSQLITE3_LIB_HEADERS); do \
@COND_SHARED_0@ if test ! -d $(DESTDIR)$(prefix)/`dirname $$f` ; then \
@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(prefix)/`dirname $$f`; \
@COND_SHARED_0@ fi; \
@COND_SHARED_0@ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(prefix)/$$f; \
@COND_SHARED_0@ done

Which means the source dir path gets mangled into the destination path because of dirname. bakefile supports the $(INCLUDEDIR) setting though, which can be used instead of $(PREFIX). However, you can still not control the directory properly because include/wx is always hardcoded because of that stupid dirname call above which is generated code.

So I just made a symlink wx to fix that. It also seems that the bakefile version used here is not maintained anymore, so I'm not going to try to fix that.

Here's the patch

diff --git a/build/wxsqlite3.bkl b/build/wxsqlite3.bkl
index 7d0f380..92d4b94 100644
--- a/build/wxsqlite3.bkl
+++ b/build/wxsqlite3.bkl
@@ -22,10 +22,10 @@

   <!-- COMP_HDR lists the component's headers with path relative to ../include -->
   <set var="COMP_HDR">
-    include/wx/wxsqlite3def.h
-   include/wx/wxsqlite3.h
-   include/wx/wxsqlite3dyn.h
-   include/wx/wxsqlite3opt.h
+    wx/wxsqlite3def.h
+   wx/wxsqlite3.h
+   wx/wxsqlite3dyn.h
+   wx/wxsqlite3opt.h
   </set>

   <set var="USE_DYNAMIC_SQLITE3_LOAD_DEFAULT">0</set>
diff --git a/wx b/wx
new file mode 120000
index 0000000..b00f3db
--- /dev/null
+++ b/wx
@@ -0,0 +1 @@
+include/wx
\ No newline at end of file
diff --git a/wxcode/bakefiles/presets/defaults.bkl b/wxcode/bakefiles/presets/defaults.bkl
index f653bad..37ab793 100644
--- a/wxcode/bakefiles/presets/defaults.bkl
+++ b/wxcode/bakefiles/presets/defaults.bkl
@@ -23,7 +23,7 @@
          you can set them once in these vars and wxcode-* templates will automatically
          use them. -->
     <set var="COMP_SRC" overwrite="0">$(fileList('src/*.c*'))</set>
-    <set var="COMP_HDR" overwrite="0">$(fileList('include/wx/*.h'))</set>
+    <set var="COMP_HDR" overwrite="0">$(fileList('wx/*.h'))</set>


     <!--    A simple variable used to understand if we are          -->
diff --git a/wxcode/bakefiles/presets/templates.bkl b/wxcode/bakefiles/presets/templates.bkl
index a18433f..d33cdf8 100644
--- a/wxcode/bakefiles/presets/templates.bkl
+++ b/wxcode/bakefiles/presets/templates.bkl
@@ -54,7 +54,7 @@

     <template id="wxcode-lib" template="wx-lib,wxlike,wxcode-basic">
         <install-to>$(LIBDIR)</install-to>
-        <install-headers-to>$(PREFIX)</install-headers-to>
+        <install-headers-to>$(INCLUDEDIR)</install-headers-to>

         <wxcode-dirname>$(SRCDIR)/lib</wxcode-dirname>
         <wxlike-libname prefix="wxcode">$(COMP_NAME)</wxlike-libname>
@@ -65,7 +65,7 @@

     <template id="wxcode-dll" template="wx,wxlike,wxcode-basic">
         <install-to>$(LIBDIR)</install-to>
-        <install-headers-to>$(PREFIX)</install-headers-to>
+        <install-headers-to>$(INCLUDEDIR)</install-headers-to>

         <wxlike-dirname>$(SRCDIR)/lib</wxlike-dirname>
         <wxlike-dllname prefix="wxcode">$(COMP_NAME)</wxlike-dllname>
-- 
2.8.1

License of linking object files .o into another language (not using .dll)

Hi,
I have a commercial application using your library. I use this because it has encryption support.
Instead of using the .dll, I want to incorporate the .o files into my application (I'm using Free Pascal).

But I need to know if not using the .dll and just using the .o files is legal for a commercial application.

Thanks.

How to compile for Android use?

How to compile for Android use? Not through Cocos2dx framework to use, direct jni call method to make the encrypted database into a decrypted database? Ask for help, Thanks.

Build fails (MSVC10)

Hello Mr. Telle,

recent changes lead to a compile error:

1>ClCompile:
1>  wxsqlite3.cpp
1>..\src\wxsqlite3.cpp(4450): error C2511: 'int wxSQLite3FunctionContext::ExecAuthorizer(void *,int,const char *,const char *,const char *,const char *,const char *)' : overloaded member function not found in 'wxSQLite3FunctionContext'
1>          D:\git\wxsqlite3\include\wx/wxsqlite3.h(214) : see declaration of 'wxSQLite3FunctionContext'
1>
1>Build FAILED.

Reason:
wxsqlite3opt.h (included by wxsqlite3.cpp) defines WXSQLITE3_USER_AUTHENTICATION in line 31:
#define WXSQLITE3_USER_AUTHENTICATION 1
but wxsqlite3.h leaves WXSQLITE3_USER_AUTHENTICATION undefined. So declaration and definition of ExecAuthorizer() diverges...

Kindly regards,
Andreas Martin

warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign

sqlite3secure/src/codec.c:
Line 961:
const unsigned char* zRaw = (const unsigned char*) userPassword + 4;
Line:2290
const char* salt = (const char*) wxsqlite3_codec_data(db, nameParam2, "cipher_salt");

sqlite3secure/src/codecext.c
Line 236:
if ((cipherSalt != NULL) && (strlen((const char*)cipherSalt) >= 2 * KEYSALT_LENGTH) && IsHexKey(cipherSalt, 2 * KEYSALT_LENGTH))

wxSQLite3Transaction::Commit() may fails silently

Hi

My question is how to report unsuccessful commits if the wxSQLite3Transaction::Commit() keeps eating all thrown exceptions if something goes wrong when trying to commit the transaction (i.e: a FK violation) ?

I had to re-throw the exception from Commit() to finally know that may script was failing due to FK violation:

void wxSQLite3Transaction::Commit()
{
  try
  {
    m_database->Commit();
  }
  catch (...)
  {
    m_database->Rollback();
    throw; // rethrow
  }
  m_database = NULL;
}

I know i know, this not the correct solution and i just want to draw your attention to this problem.

Thank you.

Errors while build (MSVC10, Release, x64)

Hello Mr. Telle,

the _UNICODE macro seems not to modify the wxw library file name:
1>LINK : fatal error LNK1181: cannot open input file 'wxbase31.lib'
As a workaround I renamed the wxShortVersionString from the property page from "31" to "31u".
Now a source seems to be missing:
1>LINK : fatal error LNK1181: cannot open input file 'wxregex.lib'

Kindly regards,
Andreas Martin

[Question] Recompiling system.data.sqlite with wxsqlite3

Hey guys (specifically Ulrich),

I'm a bit stuck in the process of compiling sqlite3 encryption with Java and C#. I am fortunate enough that somebody else has compiled a JDBC with this encryption, but it appears that I'm on my own with getting C# encryption. The default encryption method that system.data.sqlite comes with is RC4 I believe, so they are not compatible.

I recognize that this is not an issue with your repository directly, but I've scourged the internet for the past few days on these issues, and I've come across you in many different locations (sqlite mailing list, soverflow, etc..) and was hoping you could provide any advice or pointers on how to ship system.data.sqlite with your version of sqlite3.

Danke schön, wenn du mir irgendwie helfen kannst!

Problems to create 3.5.1 with TDM-GCC MinGW

Hi Ulrich,

I have some problems with the Makefile for your very nice library.
There are some changes since 3-3.3.1, the last version what I used.

  1. Missing compiler in config.gcc

Compiler is not defined inside config.gcc, the variables are empty.

#Add to config.gcc
CC = gcc
CXX = g++

  1. Include folder
    wxsqlite3.make expects include folder under wqlite3 ("-I../sqlite3/include") but folder is not exist.
    Additionally two files must be in the folder
    sqlite3.h
    sqlite3userauth.h

With this changes I am able to compile library.
Test:
mingw32-make config=debug_x64

But the story is go on.

  1. MONOLITHIC build is gone
    With current Makefile it is not possible to use wxWidgets build as MONOLITHIC library.

  2. Library name end extension is changes
    The versions up to 3-3.3.1 used
    libwxcode_msw31u_wxsqlite3.a for Release
    libwxcode_msw31ud_wxsqlite3.a for Debug

Now I will get wxsqlite3d.lib or wxsqlite3.lib
First the expected extension for GCC is .a not .lib and the second the name is changed what is not acceptable.
In reality, I cannot change every project to use new name.

Regards,
Boris

error: unknown type name 'DIR'

Hi All,

MinGW reports the following error:

Creating ../lib/gcc_lib
sqlite3secure.c
In file included from ../sqlite3/secure/src/sqlite3secure.c:117:0:
../sqlite3/secure/src/fileio.c: In function 'writefileFunc':
../sqlite3/secure/src/fileio.c:356:9: warning: implicit declaration of function 'S_ISLNK' [-Wimplicit-function-declaration]
     if( S_ISLNK(mode) ){
         ^
../sqlite3/secure/src/fileio.c: At top level:
../sqlite3/secure/src/fileio.c:410:3: error: unknown type name 'DIR'
   DIR *pDir;                 /* From opendir() */
   ^
../sqlite3/secure/src/fileio.c: In function 'fsdirResetCursor':
../sqlite3/secure/src/fileio.c:490:22: warning: implicit declaration of function 'closedir' [-Wimplicit-function-declaration]
     if( pLvl->pDir ) closedir(pLvl->pDir);
                      ^
../sqlite3/secure/src/fileio.c: In function 'fsdirNext':
../sqlite3/secure/src/fileio.c:552:18: warning: implicit declaration of function 'opendir' [-Wimplicit-function-declaration]
     pLvl->pDir = opendir(pLvl->zDir);
                  ^
../sqlite3/secure/src/fileio.c:552:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     pLvl->pDir = opendir(pLvl->zDir);
                ^
../sqlite3/secure/src/fileio.c:561:29: warning: implicit declaration of function 'readdir' [-Wimplicit-function-declaration]
     struct dirent *pEntry = readdir(pLvl->pDir);
                             ^
../sqlite3/secure/src/fileio.c:561:29: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
../sqlite3/secure/src/fileio.c:563:17: error: dereferencing pointer to incomplete type 'struct DIRENT'
       if( pEntry->d_name[0]=='.' ){
                 ^
wxsqlite3.make:411: recipe for target 'obj/x32/Debug/wxsqlite3/sqlite3secure.o' failed
mingw32-make[1]: *** [obj/x32/Debug/wxsqlite3/sqlite3secure.o] Error 1
Makefile:82: recipe for target 'wxsqlite3' failed
mingw32-make: *** [wxsqlite3] Error 2```

-Enjoy

Bug to use under Mac OS?

I use this qt plugin in order to use CipherSqlite https://github.com/devbean/QtCipherSqlitePlugin, it work good under android and windows, but not under mac os, when i specifying cipher algorithm to chacha20.

I've tracked the problem to call sqlite3_key=>
0 libsystem_kernel.dylib 0x00007fff97612452 __syscall + 10 =>syscall(SYS_getentroy, ...)
1 libsqlitecipher.dylib 0x0000000111b92513 entropy + 51
2 libsqlitecipher.dylib 0x0000000111b92413 chacha20_rng + 243
3 libsqlitecipher.dylib 0x0000000111cdf3d1 GenerateKeyChaCha20Cipher + 97
4 libsqlitecipher.dylib 0x0000000111b96d11 sqlite3CodecAttach + 1729

get an error:bad system call
But I can't solve it in depth. Any body can help me?

Cannot build static sqlite3secure shell

If I try to build sqlite3secure with configure --disable-shared --enable-static (on linux x86_64), I get the following error while linking:

./.libs/libsqlite3secure.a(sqlite3secure.o): In function `sqlite3_shathree_init':
/home/fred/Devel/Git/wxsqlite3/sqlite3secure/src/shathree.c:697: multiple definition of `sqlite3_shathree_init'
src/shell.o:/home/fred/Devel/Git/wxsqlite3/sqlite3secure/src/shell.c:2009: first defined here
./.libs/libsqlite3secure.a(sqlite3secure.o): In function `sqlite3_fileio_init':
/home/fred/Devel/Git/wxsqlite3/sqlite3secure/src/fileio.c:908: multiple definition of `sqlite3_fileio_init'
src/shell.o:/home/fred/Devel/Git/wxsqlite3/sqlite3secure/src/shell.c:2938: first defined here

I guess it works with the dynamic library because the one of shell.c is hard linked.
How do you create the files from the official sqlite3 3.24.0?

Build errors in VS12(11) project

When I tried to build the library with solution wxsqlite3_vc11.sln from build directory I got this errors:

1>ClCompile:
1>  sqlite3secure.c
1>...\wxsqlite3-4.3.0\sqlite3secure\src\codecext.c(336): error C2143: синтаксическая ошибка: отсутствие ";" перед "тип"
1>...\wxsqlite3-4.3.0\sqlite3secure\src\codecext.c(337): error C2065: dbIndex: необъявленный идентификатор
1>..\sqlite3secure\src\sqlite3secure.c(191): error C2275: CodecParameter: недопустимое использование этого типа в качестве выражения
1>          ...\wxsqlite3-4.3.0\sqlite3secure\src\codec.c(1437): см. объявление "CodecParameter"
1>

The reason of the errors that VS12(11) hasn't support for C99 (or has very limited). So all declarations need to be before any blocks.

Backup(filename, password) not working in 4.0.2

tested with m_db->Backup(newFileName.GetFullPath(), new_password); code.

v3.5.9:

  • unencrypted -> Backup(filename, wxEmptyString) 🆗
  • encrypted -> Backup(filename, wxEmptyString) 🆗
  • unencrypted -> Backup(filename, password) 🆗

v4.0.2:

  • unencrypted -> Backup(filename, wxEmptyString) 🆗
  • encrypted -> Backup(filename, wxEmptyString) 🆗
  • unencrypted -> Backup(filename, password) - new file is created, looks like encrypted, but cannot be opened with the same password...

This can be similar to #27 but for Backup function IMHO.

Does this works with windows 8 store apps?

Hi Team,

We are using "wxSQLite.WinRT81" SDK,Version="3.8.7.2" as of now. We wanted to update the SQLite version.

But we coun't find the Visual Studio Extension. Can we use this "wxSQLite3" libs in my app.

I am confused with wxSQLite and "wxSQLite3". Is there any difference?

Feature request: Support for selecting different encryption schemes at runtime

Currently work is in progress to overhaul the SQLite encryption extension coming with wxSQLite3.

At the moment it is necessary to decide at compile time which encryption scheme - AES 128-bit or AES 256-bit - should be used. It is planned to allow the selection of the encryption scheme at runtime in the future. And this will be the technical basis to be able to support additional encryption schemes (like sqleet or even SQLCipher (see issue #6)) ) later on.

The problem I'm currently struggling with is how to allow changing the encryption scheme and setting configuration parameters for the schemes.

For example, SQLCipher adds a bunch of PRAGMA statements to accomplish this. However, this requires to modify the SQLite3 source code. As a consequence upgrading to a new SQLite3 version demands a much bigger effort than just dropping in a new SQLite amalgamation (as is the case for wxSQLite3). Therefore I definitely want to avoid modifications to the SQLite3 source code.

Unfortunately, SQLite has no means to intercept the handling of PRAGMA statements. An alternative could be to define a SQLite user-defined function (UDF) for configuring the default encryption scheme and scheme parameters. The syntax would be something like

SELECT wxsqlite3_config('parameter-name', 'parameter-value'); -- Setting a parameter
SELECT wxsqlite3_config('parameter-name');                    -- Querying a parameter

The syntax is not as intuitive as a PRAGMA statement, but this method can be implemented without touching the SQLite3 source code.

In the official SQLite Encryption Extension (SEE) a different encryption scheme can be selected using a prefix to the encryption key. However, IMHO this becomes cumbersome, if one wants to pass not only the scheme name, but scheme parameters as well.

For a while, I considered to use extra parameters to a database file URI, but this would solve the issue only for opening a database (by intercepting the call to sqlite3_open - what the wxSQLite3 encryption extension does anyway). However, this trick would not work for attached databases.

Finally, it would be possible to add one or more functions for this purpose to the SQLite C Interface.

Feedback from the community would be very welcome.

Alternatives for setting cipher parameters at runtime

Currently selecting and/or configuring the encryption cipher at runtime requires to perform one or more calls to wxsqlite3_config resp wxsqlite3_config_cipher or to execute one or more SQL statements using the function wxsqlite3_config, before calling sqlite3_key or executing PRAGMA key='pass phrase';.

However, these approaches may be inconvenient or even not working under certain circumstances depending on the actual database interface.

Therefore I consider to implement an alternative for specifying cipher configuration parameters. The following 2 approaches come to mind:

  1. Using a prefix for the encryption key
    (like for example [cipher=aes256cbc;kdf_iter=12345]actual_pass_phrase)
    This approach is rather easy to implement, but requires to manipulate the pass phrase in the application.
  2. Using additional parameters in the database file URI
    (like for example file://database.db3?cipher=aes256cbc&kdf_iter=12345)
    This approach avoids to having to manipulate the pass phrase, but it is more difficult to intercept and could potentially cause conflicts in future versions of SQLite, if there happen parameter name clashes.

Questions:

  1. Which approach should be chosen?
  2. Are there other possible, maybe preferrable approaches?
  3. How should accidentally incorrectly specified parameters be handled?
    a) ignore just the invalid parameter(s)
    b) ignore all given parameters
    c) let the operation fail with an error code
    d) handle an invalid key prefix just as a regular pass phrase (including the prefix)

Feedback is welcome!

Installation

I downloaded SQLite3-master.zip.

  1. Where do I extract the files to? EXACTLY where? I'm on Linux Mint.
  2. Then what?

I'll be using wxSQLite3 with Code::Blocks.

VCRUNTIME140.dll missing on Windows 10 / 64bit

Get error message when starting on W10/64bit. MICROSOFT VISUAL STUDIO 2015 REDITRIBUTABLE installed and reinstalled few times, all older releases of MSVC uninstalled before. What Can I did more?

Compiling wxsqlite3-4.4.3

Errors in the wxsqlite3.cpp file compiled with TDM-GCC-64 and wxWidgets-3.1.2.
Is TDM-GCC-64 compatible?
regards,
Sala Carlo

Crash when rekey from a plain big db to a cypher one

crash with v4.0.4 and same with the latest tag version.

The plain db is over 200MB, and one table in this db has over 2w+ rows. When call rekey(), the program crash.

The crash stack is like:
image

The failed line:
image

The data pointed by pzErrMsg is 0xcccccccc, and then crash

The option change may like this in codecext.c line 362:
image

wish helpful,thank you very much

pkg-config file not being populated

seems strange to find a pkg-config template file in the stream but not have that file populated for install.

My experience with other packages, *.pc.in files are processed to become *.pc and available for install.
This is not done here.

Buffer underflow issue

PSV studio reports the following error on codec.c
codec.c 187 err V568 It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'ctx' class object.
codec.c 187 err V512 A call of the 'memset' function will lead to underflow of the buffer 'ctx'.

In short, this line:
memset((char ) ctx, 0, sizeof(ctx)); / In case it's sensitive */
should be replaced with:
memset((char ) ctx, 0, sizeof(MD5_CTX)); / In case it's sensitive */

BR,
Miroslav

Is there any way to find out which cipher this database uses?

Is there any way to find out which cipher this database uses? wxsqllite3_config(sqlite*, "cipher", -1) could return the cipher ID after open() invoked. But there seems be no way to get this cipher ID using SELECT. I found out SELECT wxsqlite3_config('cipher') always return the global cipher name but not the one for instance. So what about adding this feature?

BTW, since we can change cipher at runtime, why there is a compile option called CODEC_TYPE=CODEC_TYPE_AES256?

EOL problem with files in git repo

There are multiple text files in the repo stored with CRLF.

From man gitattributes:

eol
This attribute sets a specific line-ending style to be used in the working directory. It enables end-of-line conversion without any content checks, effectively setting the text attribute. Note that setting this attribute on paths which are in the index with CRLF line endings may make the paths to be considered dirty. Adding the path to the index again will normalize the line endings in the index.
[...]
Note
When text=auto conversion is enabled in a cross-platform project using push and pull to a central repository the text files containing CRLFs should be normalized.

Please verify before each commit that text files are normalized (EOL=LF only).

See moneymanagerex/moneymanagerex#1890 for affected files.

Removal of option to load SQLite library dynamically

Since wxSQLite3 version 3.5.0 (released in January 2017) the source code of the SQLite library is an integrated part of wxSQLite3 to simplify building the component and to make it easier to keep the features supported by SQLite and the wxSQLite3 wrapper in sync.

Using the symbol wxUSE_DYNAMIC_SQLITE3_LOAD it is currently still possible to select the option to load the SQLite library at runtime (DLL resp shared object). However, this opens the risk of loading a SQLite version that was not compiled with options matching those used for building the wxSQLite3 wrapper.

Therefore it is intended to remove the option to load SQLite at runtime from the next major release of wxSQLite3, unless a significant number of wxSQLite3 users object to this change.

Please share your opinions. Thanks.

Sqlcipher support

as well known that Sqlcipher is a more popular SQLite extension that provides 256 bit AES encryption of database files. i am wondering whether there is a plan to support it.

Thanks

How to support tokenizer icu?

Is the precompile version support tokenizer icu? if it's doesn't supportl icu, howto compile with icu? thanks very much!

Convertion non-encrypted database to SQLCipher/ChaCha20 format

Hi,

I am not able to convert existing non-encrypted DB into SQLCipher/ChaCha20. It lead
to crash in function CodecCopy(Codec* codec, Codec* other). It seems that
codec->m_readCipherType=0.

Following command typed into sqlite3shell.exe lead to crash.

sqlite3shell.exe test2.db

sqlite> SELECT wxsqlite3_config("cipher", "sqlcipher" );
sqlite> pragma rekey='pass';

test2.db is unencrypted database with one table.
It seems that in this case is needed to use sqlite3RunVacuumForRekey which later lead to crash.

No problem with CODEC_TYPE_AES128 and CODEC_TYPE_AES256.
Also is possible to create empty encrypted database with every codec.

Thanks

GetExpandedSQL has a memory leak

Using GetExpandedSQL() on a wxSQLite3Statement causes a memory leak. Tracing into GetExExpandedSQL() takes us to a function in SQLite3, namely sqlite3_expanded_sql(). This function has the comment that The caller is responsible for freeing the returned string by passing it to sqlite3_free() on the returned pointer.

As GetExpandedSQL() converts the string returned to it into a wxString, wxString does it's own freeing of the memory, but it certainly doesn't know about, or call, sqlite3_free().

This causes a memory leak. If this is by design, the documentation for GetExpandedSQL() should advise the user of the fact. If not, then here is a proposed fix of the code. It (by nessessity) removes the const from the call to sqlite3_expanded_sql(), then calls sqlite3_free() on the pointer after the wxString creation.

wxString wxSQLite3Statement::GetExpandedSQL() const
{
   wxString sqlString = wxEmptyString;

#if SQLITE_VERSION_NUMBER >= 3014000

   CheckStmt();
   /*const*/ char* sqlLocal = sqlite3_expanded_sql(m_stmt->m_stmt);
   if (sqlLocal != NULL) sqlString = wxString::FromUTF8(sqlLocal);
   sqlite3_free(sqlLocal);  /* NEW CODE */

#endif
   return sqlString;
}

(also in wxString wxSQLite3ResultSet::GetExpandedSQL() const)

PVS Studio warnings for rijndael.c

PVS reported these warnings for rijndael.c file:
rijndael.c 1103 warn V756 The 'i' counter is not used inside a nested loop. Consider inspecting usage of 'k' counter.
rijndael.c 1256 warn V756 The 'i' counter is not used inside a nested loop. Consider inspecting usage of 'k' counter.

Not sure how to fix this, but the loop does look strange (as if outer loop was meant to progress through multiple blocks but it does not do anything).
Could be false warning though.

BR,
Miroslav

sqlite3secure warnings on linux

When building moneymanagerex which uses wxsqlite3 with secure and extension functions on Linux I got following errors:

/home/dawid/Development/mmex/build/bk-deps g++ -c -o wxsqlite_wxsqlite3.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -std=c++11 -g0 -O2 ../lib/wxsqlite3/src/wxsqlite3.cpp
/home/dawid/Development/mmex/build/bk-deps gcc -c -o wxsqlite_sqlite3secure.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -g0 -O2 ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:68:0:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:213:25: error: conflicting types for ‘i64’
 typedef int64_t         i64;
                         ^
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:13:0:
../lib/wxsqlite3/sqlite3/secure/src/sqlite3.c:9627:22: note: previous declaration of ‘i64’ was here
 typedef sqlite_int64 i64;          /* 8-byte signed integer */
                      ^
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:68:0:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c: In function ‘print_elem’:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:1966:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
   printf("%d => %lld\n", ee,c);
   ^
make: *** [wxsqlite_sqlite3secure.o] Error 1

It looks wxsqlite3 related.

g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3

Config interface: global parameter table

It seems unclear to me how to use the global parameter table for wxsqlite3_config() and wxsqlite3_config_cipher(). From the documentation:

sqlite3* db, /* Database instance (use NULL for global parameter table) */

However, if db == NULL, then wxsqlite3_config() and wxsqlite3_config_cipher() won't allow setting a new value at all: codec.c line 1791 and line 1863

Is the global parameter table intended to be read-only, or do I just simply get this wrong? The documentation states that I should be able to write it:

It is recommended to manipulate the global parameter tables only before opening any database connection.

Standard SQLite compatibility

Using "official"sqlite binary for windows for few years, but ICU support missing. Today found wxsqlite and this have question: Could wxsqlite windows binariy be used instead of "official" one, without any limits with advance of ICU extensions?

thanks, L.

config.gcc should not specify compiler version number - breaks wxwidgets lib paths

The variable wxCompilerPrefix in config.gcc specifies the compiler version number but really shouldn't as the makefiles use it to determine the path to wxWidgets libs.
so:

wxCompilerPrefix ?= gcc720

results in paths like:

wxWidgets/lib/gcc720_dll/mswu
wxWidgets/lib/gcc720_lib/mswu

should default to:

wxCompilerPrefix ?= gcc

to produce paths like:

wxWidgets/lib/gcc_dll/mswu
wxWidgets/lib/gcc_lib/mswu

sample linking errors for mingw

The treeview.make file has a couple issues that prevent it from building:

The library linking order is incorrect and it's missing the uxtheme lib.

I got release_x32 to build by changing the LIBS variable to be:

LIBS += ../lib/gcc_lib/libwxsqlite3$(wxFlavour).a -l$(wxBaseLibNamePrefix)_xml -l$(wxToolkitLibNamePrefix)adv -l$(wxToolkitLibNamePrefix)core -l$(wxBaseLibNamePrefix) -lwxjpeg$(wxSuffixDebug) -lwxpng$(wxSuffixDebug) -lwxzlib$(wxSuffixDebug) -lwxtiff$(wxSuffixDebug) -lwxexpat$(wxSuffixDebug) -lwxregex$(wxSuffix) -lcomctl32 -lrpcrt4 -lshell32 -lgdi32 -lkernel32 -luser32 -lcomdlg32 -lole32 -loleaut32 -ladvapi32 -loleacc -lwinspool -lwinmm -lshlwapi -luuid -lversion -lwsock32 -lwininet -luxtheme

minimal.make suffers from similar issues. Here is what worked for me to build release_x32:

LIBS += ../lib/gcc_lib/libwxsqlite3$(wxFlavour).a -l$(wxToolkitLibNamePrefix)core -l$(wxBaseLibNamePrefix) -lwxjpeg$(wxSuffixDebug) -lwxpng$(wxSuffixDebug) -lwxzlib$(wxSuffixDebug) -lwxtiff$(wxSuffixDebug) -lwxexpat$(wxSuffixDebug) -lwxregex$(wxSuffix) -lcomctl32 -lrpcrt4 -lshell32 -lgdi32 -lkernel32 -luser32 -lcomdlg32 -lole32 -loleaut32 -ladvapi32 -loleacc -lwinspool -lwinmm -lshlwapi -luuid -lversion -lwsock32 -lwininet -luxtheme

This was with mingw64 on win 7 with the following config:

i686-8.1.0-posix-sjlj-rt_v6-rev0

CODEC_TYPE_* defines

The CODEC_TYPE defines can't be (easily) included by external code because codec.h isn't a self-sufficient header file.

Since the CODEC_TYPE defines are intended to be used for the newValue parameter of wxsqlite3_config(), it would be nice to have sqlite3secure.h define them as part of the interface.

Issues with building wxsqlite3-3.5.3 on gcc - setup.h

Hi,

I'm not able to build the latest version.
wxWidgets-3.1.0
TDM-GCC 5.1.0

set COMMON_FLAGS=-f Makefile CODEC_TYPE=CODEC_TYPE_AES256 WXSQLITE3_HAVE_METADATA=1 SQLITE_HAS_CODEC=1 WXSQLITE3_HAVE_CODEC=1 SQLITE_CORE=1 THREADSAFE=1 SQLITE_SECURE_DELETE=1 SQLITE_SOUNDEX=1 SQLITE_ENABLE_COLUMN_METADATA=1 CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport" WXWIN=%WXWIDGETS_ROOT_DIR%

mingw32-make.exe %COMMON_FLAGS% config=debug_x64 all

gives the following error:

"==== Building wxsqlite3 (debug_x64) ===="
wxsqlite3.cpp
In file included from c:/!ST/Tools.Develop/wxWidgets/include/wx/defs.h:20:0,
                 from c:/!ST/Tools.Develop/wxWidgets/include/wx/wxprec.h:12,
                 from ../src/wxsqlite3.cpp:18:
c:/!ST/Tools.Develop/wxWidgets/include/wx/platform.h:136:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
wxsqlite3.make:414: recipe for target 'obj/x64/Debug/wxsqlite3/wxsqlite3.o' failed
mingw32-make.exe[1]: *** [obj/x64/Debug/wxsqlite3/wxsqlite3.o] Error 1
Makefile:82: recipe for target 'wxsqlite3' failed
mingw32-make.exe: *** [wxsqlite3] Error 2

How do I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.