1
///////////////////////////////////////////////////////////////////////////////
2
// Name: wxsqlite3def.h
3
// Purpose: wxWidgets wrapper around the SQLite3 embedded database library.
4
// Author: Ulrich Telle
7
// Changes: 2005-10-03 - Upgrade to SQLite3 version 3.2.7
8
// 2005-10-09 - Corrected error in wxSQLite3Table::FindColumnIndex
9
// 2005-10-30 - Added wxGTK build support
10
// 2005-11-01 - Corrected wxSQLite3ResultSet::GetInt64.
11
// Added wxSQLite3Table::GetInt64
12
// 2005-11-09 - Optionally load SQLite library dynamically
13
// 2006-02-01 - Upgrade to SQLite3 version 3.3.3
14
// 2006-02-12 - Upgrade to SQLite3 version 3.3.4 (wxMSW only)
15
// 2006-03-15 - Fixed a bug in wxSQLite3Database::Prepare
16
// Added wxSQLite3Database::IsOpen for convenience
17
// 2006-06-11 - Upgrade to SQLite3 version 3.3.6
18
// Added support for optional SQLite meta data methods
19
// 2007-01-11 - Upgrade to SQLite3 version 3.3.10
20
// Added support for BLOBs as wxMemoryBuffer objects
21
// Added support for loadable extensions
22
// Optional support for key based database encryption
23
// 2007-02-12 - Upgrade to SQLite3 version 3.3.12
24
// 2007-05-01 - Upgrade to SQLite3 version 3.3.17
25
// 2007-10-28 - Upgrade to SQLite3 version 3.5.2
26
// 2007-11-17 - Fixed a bug in wxSQLite3Database::Close
27
// Eliminated several compile time warnings
28
// 2007-12-19 - Upgrade to SQLite3 version 3.5.4
29
// Fixed a bug in wxSQLite3Database::Begin
30
// 2008-01-05 - Added support for shared cache mode
31
// Added support for access to original SQL statement
32
// for prepared statements (requires SQLite 3.5.3 or above)
33
// 2008-04-27 - Upgrade to SQLite3 version 3.5.8
34
// Fixed several minor issues in the build files
35
// 2008-06-28 - Upgrade to SQLite3 version 3.5.9
36
// 2008-07-19 - Upgrade to SQLite3 version 3.6.0
37
// 2008-09-04 - Upgrade to SQLite3 version 3.6.2
38
// 2008-11-22 - Upgrade to SQLite3 version 3.6.6
39
// 2008-12-18 - Upgrade to SQLite3 version 3.6.7
40
// Fixed a bug in method wxSQLite3Table::GetDouble
41
// 2009-01-14 - Upgrade to SQLite3 version 3.6.10
42
// Added savepoint support
43
// Added IsOk methods to some classes
45
// Copyright: (c) Ulrich Telle
46
// Licence: wxWindows licence
47
///////////////////////////////////////////////////////////////////////////////
49
/// \file wxsqlite3def.h Compile time switches for the wxSQLite3 class
51
/** \mainpage wxSQLite3
53
\section intro What is wxSQLite3?
55
\b wxSQLite3 is a C++ wrapper around the public domain <a href="http://www.sqlite.org">SQLite 3.x</a> database
56
and is specifically designed for use in programs based on the \b wxWidgets library.
58
Several solutions already exist to access SQLite databases. To name just a few:
60
- <a href="http://sourceforge.net/projects/wxsqlite">wxSQLite</a> :
61
This is a wxWidgets wrapper for version 2.8.x of SQLite.
62
SQLite version 3.x has a lot more features - which are not supported by this wrapper.
64
- <a href="http://www.codeproject.com/database/CppSQLite.asp">CppSQLite</a> :
65
Not wxWidgets specific, but with (partial) support for the newer version 3.x of SQLite.
67
- <a href="http://wxcode.sf.net">DatabaseLayer</a> :
68
This is a database abstraction providing a JDBC-like interface to database I/O.
69
In the current version SQLite3, PostgreSQL, MySQL, Firebird, and ODBC database backends
72
The component \b wxSQLite3 was inspired by all three mentioned SQLite wrappers.
73
\b wxSQLite3 does not try to hide the underlying database, in contrary almost all special features
74
of the SQLite3 version 3.x are supported, like for example the creation of user defined
75
scalar or aggregate functions.
77
Since SQLite stores strings in UTF-8 encoding, the wxSQLite3 methods provide automatic conversion
78
between wxStrings and UTF-8 strings. This works best for the \b Unicode builds of \b wxWidgets.
79
In \b ANSI builds the current locale conversion object \b wxConvCurrent is used for conversion
80
to/from UTF-8. Special care has to be taken if external administration tools are used to modify
81
the database contents, since not all of these tools operate in Unicode or UTF-8 mode.
83
\section version Version history
87
<dt><b>1.9.4</b> - <i>January 2009</i></dt>
89
Upgrade to SQLite version 3.6.10<br>
90
Added support for savepoints, introduced with SQLite 3.6.8<br>
91
Added method IsOk to the classes wxSQLite3Statement, wxSQLite3Table and wxSQLite3ResultSet,
92
thus instances of these classes can be checked whether the associated SQLite database or
93
statement are valid without throwing an exception.<br>
96
<dt><b>1.9.3</b> - <i>December 2008</i></dt>
98
Upgrade to SQLite version 3.6.7<br>
99
Fixed a bug in method wxSQLite3Table::GetDouble
100
(conversion from string to double failed in non-US locales)<br>
101
Build system upgraded using Bakefile 0.2.5<br>
104
<dt><b>1.9.2</b> - <i>November 2008</i></dt>
106
Upgrade to SQLite version 3.6.6<br>
107
Added RAII transaction class (see docs for details)<br>
110
<dt><b>1.9.1</b> - <i>September 2008</i></dt>
112
Upgrade to SQLite version 3.6.2<br>
113
Introduced own step counting for aggregate user functions
114
since the sqlite3_aggregate_count function is now deprecated<br>
115
Enhanced wxSQLite3Database::TableExists method to query an attached database
116
for existence of a table or to query the main database and all attached databases<br>
119
<dt><b>1.9.0</b> - <i>July 2008</i></dt>
121
Upgrade to SQLite version 3.6.0<br>
122
The optional key based encryption support has been adapted to
123
support SQLite version 3.6.0.<br>
124
Added static methods to initialize and shutdown the SQLite library.<br>
125
Changed build system to support static library build against shared
126
wxWidgets build on Linux.<br>
127
Changed behaviour of wxSQLite3Database::Close method to finalize
128
all unfinalized prepared statements.
131
<dt><b>1.8.5</b> - <i>June 2008</i></dt>
133
Upgrade to SQLite version 3.5.9<br>
134
Integration of the optional key based encryption support into SQLite
135
has been made easier. Changes to original SQLite source files
136
are no longer necessary.
139
<dt><b>1.8.4</b> - <i>April 2008</i></dt>
141
Upgrade to SQLite version 3.5.8<br>
142
Added support for accessing database limits<br>
143
Changed method TableExists to check a table name case insensitive<br>
144
Fixed several minor issues in the build files.
147
<dt><b>1.8.3</b> - <i>January 2008</i></dt>
149
Added support for shared cache mode<br>
150
Added support for access to original SQL statement
151
for prepared statements (requires SQLite 3.5.3 or above)
154
<dt><b>1.8.2</b> - <i>December 2007</i></dt>
156
Upgrade to SQLite version 3.5.4<br>
157
Fixed a bug in wxSQLite3Database::Begin (wrong transaction type)
160
<dt><b>1.8.1</b> - <i>November 2007</i></dt>
162
Fixed a bug in in wxSQLite3Database::Close (resetting flag m_isEncrypted)<br>
163
Eliminated several compile time warnings (regarding unused parameters)<br>
164
Fixed a compile time bug in wxSQLite3Database::GetBlob (missing explicit type cast)
167
<dt><b>1.8.0</b> - <i>November 2007</i></dt>
169
Upgrade to SQLite version 3.5.2<br>
170
Support for SQLite incremental BLOBs<br>
171
Changed source code in the SQLite3 encryption extension to eliminate several warnings<br>
172
Changed default wxWidgets version to 2.8.x<br>
173
Adjusted sources for SQLite encryption support are included for all SQLite version from 3.3.1 up to 3.5.2<br>
174
SQLite link libraries for MinGW on Windows are included<br>
175
Added <code>WXMAKINGLIB_WXSQLITE3</code> compile time option
176
to support building wxSQLite3 as a static library while
177
using the shared libraries of wxWidgets.
180
<dt><b>1.7.3</b> - <i>May 2007</i></dt>
182
Upgrade to SQLite version 3.3.17<br>
184
Fixed a bug in the SQLite3 encryption extension
185
(MD5 algorithm was not aware of endianess on
186
big-endian platforms, resulting in non-portable
190
<dt><b>1.7.2</b> - <i>February 2007</i></dt>
192
Upgrade to SQLite version 3.3.12<br>
193
Support for loadable extensions is now optional
194
Check for optional wxSQLite3 features at runtime
195
wxSQLite3 API independent of optional features
198
<dt><b>1.7.1</b> - <i>January 2007</i></dt>
200
Fixed a bug in the key based database encryption feature
201
(The call to <b>sqlite3_rekey</b> in wxSQLite3Database::ReKey
202
could cause a program crash, when used to encrypt a previously
203
unencrypted database.)<br>
206
<dt><b>1.7.0</b> - <i>January 2007</i></dt>
208
Upgrade to SQLite version 3.3.10 (<b>Attention</b>: at least SQLite version 3.3.9 is required)<br>
209
Added support for BLOBs as wxMemoryBuffer objects<br>
210
Added support for loadable extensions<br>
211
Optional support for key based database encryption
214
<dt><b>1.6.0</b> - <i>July 2006</i></dt>
216
Added support for user defined collation sequences
219
<dt><b>1.5.3</b> - <i>June 2006</i></dt>
221
Upgrade to SQLite version 3.3.6<br>
222
Added support for optional SQLite meta data methods
225
<dt><b>1.5.2</b> - <i>March 2006</i></dt>
227
Fixed a bug in wxSQLite3Database::Prepare<br>
228
Added wxSQLite3Database::IsOpen for convenience
231
<dt><b>1.5.1</b> - <i>February 2006</i></dt>
233
Upgrade to SQLite version 3.3.4 (wxMSW only)
236
<dt><b>1.5</b> - <i>February 2006</i></dt>
238
Upgrade to SQLite version 3.3.3<br>
239
Added support for commit, rollback and update callbacks
242
<dt><b>1.4.2</b> - <i>November 2005</i></dt>
244
Optimized code for wxString arguments
247
<dt><b>1.4.1</b> - <i>November 2005</i></dt>
249
Fixed a bug in wxSQLite3Database::TableExists,<br>
250
Changed the handling of Unicode string conversion,<br>
251
Added support for different transaction types
254
<dt><b>1.4</b> - <i>November 2005</i></dt>
256
Optionally load the SQLite library dynamically at run time.
259
<dt><b>1.3.1</b> - <i>November 2005</i></dt>
261
Corrected wxSQLite3ResultSet::GetInt64.<br>
262
Added wxSQLite3Table::GetInt64
265
<dt><b>1.3</b> - <i>October 2005</i></dt>
267
Added wxGTK build support<br>
270
<dt><b>1.2</b> - <i>October 2005</i></dt>
272
Corrected error in wxSQLite3Table::FindColumnIndex<br>
275
<dt><b>1.1</b> - <i>October 2005</i></dt>
277
Upgrade to SQLite version 3.2.7 <br>
281
<dt><b>1.0</b> - <i>July 2005</i></dt>
287
\author Ulrich Telle (<a href="mailto:ulrich.telle@gmx.de">ulrich DOT telle AT gmx DOT de</a>)
289
\section ackn Acknowledgements
291
The following people have contributed to wxSQLite3:
294
<li>Francesco Montorsi (enhancement of the build system)</li>
295
<li>Neville Dastur (enhancement of the method TableExists)</li>
296
<li>Tobias Langner (RAII class for managing transactions)</li>
301
#ifndef _WX_SQLITE3_DEF_H_
302
#define _WX_SQLITE3_DEF_H_
304
#if defined(WXMAKINGLIB_WXSQLITE3)
305
#define WXDLLIMPEXP_SQLITE3
306
#elif defined(WXMAKINGDLL_WXSQLITE3)
307
#define WXDLLIMPEXP_SQLITE3 WXEXPORT
308
#elif defined(WXUSINGDLL_WXSQLITE3)
309
#define WXDLLIMPEXP_SQLITE3 WXIMPORT
310
#else // not making nor using DLL
311
#define WXDLLIMPEXP_SQLITE3
314
#endif // _WX_SQLITE3_DEF_H_