Skip to content

Commit

Permalink
Release of wxSQLite3 4.1.0
Browse files Browse the repository at this point in the history
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
Enabled GEOPOLY extension for SQLite
  • Loading branch information
utelle committed Sep 21, 2018
1 parent 0d1189c commit d19bfad
Show file tree
Hide file tree
Showing 59 changed files with 32,117 additions and 24,413 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sqlite3secure/src $(WX_CXX
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sqlite3secure/src $(WX_CXXFLAGS)

AM_CXXFLAGS += -DwxUSE_DYNAMIC_SQLITE3_LOAD=0 -DWXSQLITE3_HAVE_METADATA=1 -DWXSQLITE3_USER_AUTHENTICATION=1 -DWXSQLITE3_HAVE_CODEC=1 -DWXSQLITE3_HAVE_LOAD_EXTENSION=0
AM_CFLAGS += -std=c99 -DTHREADSAFE=1 -DSQLITE_MAX_ATTACHED=10 -DSQLITE_SOUNDEX -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_HAS_CODEC=1 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_CORE -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_CSV -DSQLITE_ENABLE_SHA3 -DSQLITE_ENABLE_CARRAY -DSQLITE_ENABLE_FILEIO -DSQLITE_ENABLE_SERIES -DSQLITE_TEMP_STORE=2 -DSQLITE_USE_URI -DSQLITE_USER_AUTHENTICATION
AM_CFLAGS += -std=c99 -DTHREADSAFE=1 -DSQLITE_MAX_ATTACHED=10 -DSQLITE_SOUNDEX -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_HAS_CODEC=1 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY -DSQLITE_CORE -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_CSV -DSQLITE_ENABLE_SHA3 -DSQLITE_ENABLE_CARRAY -DSQLITE_ENABLE_FILEIO -DSQLITE_ENABLE_SERIES -DSQLITE_TEMP_STORE=2 -DSQLITE_USE_URI -DSQLITE_USER_AUTHENTICATION

LDADD = lib@[email protected] $(WX_LIBS)

Expand Down
24 changes: 12 additions & 12 deletions build/wxsqlite3.make

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions build/wxsqlite3_mono.make

Large diffs are not rendered by default.

1,092 changes: 546 additions & 546 deletions build/wxsqlite3_vc10_wxsqlite3.vcxproj

Large diffs are not rendered by default.

1,116 changes: 558 additions & 558 deletions build/wxsqlite3_vc11_wxsqlite3.vcxproj

Large diffs are not rendered by default.

1,118 changes: 559 additions & 559 deletions build/wxsqlite3_vc12_wxsqlite3.vcxproj

Large diffs are not rendered by default.

1,118 changes: 559 additions & 559 deletions build/wxsqlite3_vc14_wxsqlite3.vcxproj

Large diffs are not rendered by default.

1,118 changes: 559 additions & 559 deletions build/wxsqlite3_vc15_wxsqlite3.vcxproj

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dnl Copyright (C) 2017-2018 Ulrich Telle <[email protected]>, Vadim Zeitlin
dnl
dnl This file is covered by the same licence as the entire wxSQLite3 package.

AC_INIT([wxsqlite3], [4.0.4], [[email protected]])
AC_INIT([wxsqlite3], [4.1.0], [[email protected]])

dnl This is the version tested with, might work with earlier ones.
AC_PREREQ([2.69])
Expand All @@ -31,12 +31,18 @@ WX_CONFIG_CHECK([2.8.0],

AC_ARG_ENABLE(codec,
[ --enable-codec[=<codec type>] Specify the codec type:
aes128 [default]: AES 128 Bit Encryption
aes256: AES 256 Bit Encryption],
aes128: AES 128 Bit CBC Encryption
aes256: AES 256 Bit CBC Encryption
chacha20 [default]: ChaCha20-Poly1305 Encryption
sqlcipher: SQLCipher Encryption],
[ if test "x$enableval" = "xaes128" ; then
codec_type=CODEC_TYPE_AES128
elif test "x$enableval" = "xaes256" ; then
codec_type=CODEC_TYPE_AES256
elif test "x$enableval" = "xchacha20" ; then
codec_type=CODEC_TYPE_CHACHA20
elif test "x$enableval" = "xsqlcipher" ; then
codec_type=CODEC_TYPE_SQLCIPHER
else
echo
echo "Error!"
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = wxSQLite3
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 4.0.4
PROJECT_NUMBER = 4.1.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
82 changes: 78 additions & 4 deletions include/wx/wxsqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3FunctionContext
/// Execute the final step of a user defined aggregate function (internal use only)
static void ExecAggregateFinalize(void* ctx);

/// Execute an aggregate step of a user defined aggregate window function (internal use only)
static void ExecWindowStep(void* ctx, int argc, void** argv);

/// Execute the final step of a user defined aggregate window function (internal use only)
static void ExecWindowFinalize(void* ctx);

/// Execute the current value step of a user defined aggregate window function (internal use only)
static void ExecWindowValue(void* ctx);

/// Execute the inverse step of a user defined aggregate window function (internal use only)
static void ExecWindowInverse(void* ctx, int argc, void** argv);

/// Execute the user defined commit hook (internal use only)
static int ExecCommitHook(void* hook);

Expand Down Expand Up @@ -486,6 +498,55 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3AggregateFunction
friend class wxSQLite3FunctionContext;
};

/// Interface for user defined aggregate window functions
/**
*/
class WXDLLIMPEXP_SQLITE3 wxSQLite3WindowFunction
{
public:
/// Constructor
wxSQLite3WindowFunction() { m_count = 0; }

/// Virtual destructor
virtual ~wxSQLite3WindowFunction() {}

/// Execute the aggregate of the window function
/**
* This method is invoked for each row of the result set of the query using the aggregate window function.
* \param ctx function context which can be used to access arguments and result value
*/
virtual void Aggregate(wxSQLite3FunctionContext& ctx) = 0;

/// Prepare the result of the aggregate window function
/**
* This method is invoked after all rows of the result set of the query
* using the aggregate window function have been processed. Usually the final result
* is calculated and returned in this method.
* \param ctx function context which can be used to access arguments and result value
*/
virtual void Finalize(wxSQLite3FunctionContext& ctx) = 0;

/// Get current value of the aggregate window function
/**
* This method is invoked to return the current value of the aggregate.
* Unlike Finalize, the implementation should not delete any context.
* \param ctx function context which can be used to access arguments and result value
*/
virtual void CurrentValue(wxSQLite3FunctionContext& ctx) = 0;

/// Reverse an aggregate step of the window function
/**
* This method is invoked to remove a row from the current window.
* The function arguments, if any, correspond to the row being removed.
* \param ctx function context which can be used to access arguments and result value
*/
virtual void Reverse(wxSQLite3FunctionContext& ctx) = 0;

private:
int m_count; ///< Aggregate count
friend class wxSQLite3FunctionContext;
};


/// Interface for a user defined authorizer function
/**
Expand Down Expand Up @@ -3040,28 +3101,41 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3Database
/// Create a user-defined scalar function
/**
* Registers a SQL scalar function with the database.
* \param name
* \param funcName name of the scalar function
* \param argCount number of arguments the scalar function takes.
* If this argument is -1 then the scalar function may take any number of arguments.
* \param function instance of an scalar function
* \param isDeterministic signals whether the function will always return the same result
* for the same input within a single SQL statement. (Default: false)
* \return TRUE on successful registration, FALSE otherwise
*/
bool CreateFunction(const wxString& name, int argCount, wxSQLite3ScalarFunction& function, bool isDeterministic = false);
bool CreateFunction(const wxString& funcName, int argCount, wxSQLite3ScalarFunction& function, bool isDeterministic = false);

/// Create a user-defined aggregate function
/**
* Registers a SQL aggregate function with the database.
* \param name
* \param funcName name of the aggregate function
* \param argCount number of arguments the aggregate function takes.
* If this argument is -1 then the aggregate function may take any number of arguments.
* \param function instance of an aggregate function
* \param isDeterministic signals whether the function will always return the same result
* for the same input within a single SQL statement. (Default: false)
* \return TRUE on successful registration, FALSE otherwise
*/
bool CreateFunction(const wxString& name, int argCount, wxSQLite3AggregateFunction& function, bool isDeterministic = false);
bool CreateFunction(const wxString& funcName, int argCount, wxSQLite3AggregateFunction& function, bool isDeterministic = false);

/// Create a user-defined aggregate window function
/**
* Registers a SQL aggregate window function with the database.
* \param funcName name of the aggregate window function
* \param argCount number of arguments the aggregate window function takes.
* If this argument is -1 then the aggregate function may take any number of arguments.
* \param function instance of an aggregate window function
* \param isDeterministic signals whether the function will always return the same result
* for the same input within a single SQL statement. (Default: false)
* \return TRUE on successful registration, FALSE otherwise
*/
bool CreateFunction(const wxString& funcName, int argCount, wxSQLite3WindowFunction& function, bool isDeterministic = false);

/// Create a user-defined authorizer function
/**
Expand Down
6 changes: 3 additions & 3 deletions include/wx/wxsqlite3_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#define _WXSQLITE3_VERSION_H_

#define WXSQLITE3_MAJOR_VERSION 4
#define WXSQLITE3_MINOR_VERSION 0
#define WXSQLITE3_RELEASE_NUMBER 4
#define WXSQLITE3_MINOR_VERSION 1
#define WXSQLITE3_RELEASE_NUMBER 0
#define WXSQLITE3_SUBRELEASE_NUMBER 0
#define WXSQLITE3_VERSION_STRING "wxSQLite3 4.0.4"
#define WXSQLITE3_VERSION_STRING "wxSQLite3 4.1.0"

#endif // _WXSQLITE3_VERSION_H_
7 changes: 7 additions & 0 deletions include/wx/wxsqlite3def.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
<dl>
<dt><b>4.1.0</b> - <i>September 2018</i></dt>
<dd>
Upgrade to SQLite version 3.25.1<br>
Added support for SQL window functions<br>
Adjusted encryption extension to check for matching page sizes on rekeying a database<br>
</dd>
<dt><b>4.0.4</b> - <i>June 2018</i></dt>
<dd>
Upgrade to SQLite version 3.24.0<br>
Expand Down
3 changes: 3 additions & 0 deletions include/wx/wxsqlite3dyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ DYNFUNC(return, int, sqlite3_create_function, (sqlite3 *
#if SQLITE_VERSION_NUMBER >= 3007003
DYNFUNC(return, int, sqlite3_create_function_v2, (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void (*xFunc)(sqlite3_context*,int,sqlite3_value**), void (*xStep)(sqlite3_context*,int,sqlite3_value**), void (*xFinal)(sqlite3_context*), void(*xDestroy)(void*)), (db, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal, xDestroy));
#endif
#if SQLITE_VERSION_NUMBER >= 3025000
DYNFUNC(return, int, sqlite3_create_window_function, (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void (*xStep)(sqlite3_context*,int,sqlite3_value**), void (*xFinal)(sqlite3_context*), void (*xValue)(sqlite3_context*), void (*xInverse)(sqlite3_context*,int,sqlite3_value**), void (*xDestroy)(void*)), (db, zFunctionName, nArg, eTextRep, pApp, xStep, xFinal, xValue, xInverse, xDestroy));
#endif
#if SQLITE_VERSION_NUMBER >= 3004001
DYNFUNC(return, int, sqlite3_create_module, (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData), (db, zName, p, pClientData));
DYNFUNC(return, int, sqlite3_create_module_v2, (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData, void(*xDestroy)(void*)), (db, zName, p, pClientData, xDestroy));
Expand Down
Loading

0 comments on commit d19bfad

Please sign in to comment.