mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Updated version to 1.0.0 changelog and copyright date
This commit is contained in:
parent
e537195625
commit
09db07ccc7
@ -41,6 +41,19 @@ Version 0.7.0 - January 9 2014
|
||||
Added std::string version of existing APIs
|
||||
Improved CMake with more build options and Doxygen auto-detection
|
||||
|
||||
Version 0.8.0 - Februrary 26 2014
|
||||
Version 0.8.0 - February 26 2014
|
||||
Database constructor support opening a database with a custom VFS (default to NULL)
|
||||
Changed Column::getText() to return empty string "" by default instead of NULL pointer (to handle std::string conversion)
|
||||
|
||||
Version 1.0.0 - pending May 2015
|
||||
Public headers file moved to include/ dir
|
||||
Added support to biicode in CMakeLists.txt
|
||||
Added Unit Tests
|
||||
Added a aBusyTimeoutMs parameter to Database() constructors
|
||||
Added a Database::getTotalChanges()
|
||||
Added a Database::getErrorCode()
|
||||
Added a Statement::clearBindings()
|
||||
Added a Statement::getColumn(aName)
|
||||
Added a Statement::getErrorCode()
|
||||
Added a Statement::getColumnName(aIndex)
|
||||
Added a Statement::getColumnOriginName(aIndex)
|
||||
|
17
TODO.txt
17
TODO.txt
@ -1,24 +1,23 @@
|
||||
Add a full googletest suite
|
||||
|
||||
Add a Tutorial: for SQLite newbies
|
||||
Create Github Wiki pages with the README.md and FAQ.txt: Installation, Examples, Tutorial, How to contribute
|
||||
|
||||
Publish a versionned ZIP file in Google Project Mirror
|
||||
Improve Github Wiki pages with the FAQ: Installation, Examples, Tutorial, How to contribute
|
||||
|
||||
Publish the Doxygen Documentation in the Github Pages (gh-pages branch)
|
||||
|
||||
Missing features in v0.9.9:
|
||||
- getColumnByName() (issue #23) ? std::map getRow() ?
|
||||
Missing features in v1.0.0:
|
||||
- bind a SQLITE_STATIC value (string/blob)
|
||||
- bind a dynamic value with zerocopy (unlike SQLITE_TRANSIENT) with custom deleter
|
||||
|
||||
Missing documentation in v0.9.9:
|
||||
Missing documentation in v1.0.0:
|
||||
- explain the noncopyable property for RAII design
|
||||
- comment on returning error code instead of exception that shall not be thrown when exepected (!?)
|
||||
|
||||
Missing unit tests in v1.0.0:
|
||||
- Create Function
|
||||
- Assert Handler
|
||||
- Binding variants
|
||||
|
||||
Advanced missing features:
|
||||
- backup support to/from file/:memory:
|
||||
- Function ?
|
||||
- Agregate ?
|
||||
- support for different transaction mode ? NO: too specific
|
||||
- operator<< binding ? NO: redundant with bind()
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Demonstrates how-to use the SQLite++ wrapper
|
||||
*
|
||||
* Copyright (c) 2012-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
* Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
*
|
||||
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
* or copy at http://opensource.org/licenses/MIT)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @ingroup SQLiteCpp
|
||||
* @brief Encapsulation of a Column in a row of the result pointed by the prepared SQLite::Statement.
|
||||
*
|
||||
* Copyright (c) 2012-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
* Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
*
|
||||
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
* or copy at http://opensource.org/licenses/MIT)
|
||||
|
@ -53,17 +53,17 @@ public:
|
||||
*
|
||||
* Exception is thrown in case of error, then the Database object is NOT constructed.
|
||||
*
|
||||
* @param[in] apFilename UTF-8 path/uri to the database file ("filename" sqlite3 parameter)
|
||||
* @param[in] aFlags SQLITE_OPEN_READONLY/SQLITE_OPEN_READWRITE/SQLITE_OPEN_CREATE...
|
||||
* @param[in] aTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY (see setBusyTimeout())
|
||||
* @param[in] apVfs UTF-8 name of custom VFS to use, or nullptr for sqlite3 default
|
||||
* @param[in] apFilename UTF-8 path/uri to the database file ("filename" sqlite3 parameter)
|
||||
* @param[in] aFlags SQLITE_OPEN_READONLY/SQLITE_OPEN_READWRITE/SQLITE_OPEN_CREATE...
|
||||
* @param[in] aBusyTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY (see setBusyTimeout())
|
||||
* @param[in] apVfs UTF-8 name of custom VFS to use, or nullptr for sqlite3 default
|
||||
*
|
||||
* @throw SQLite::Exception in case of error
|
||||
*/
|
||||
Database(const char* apFilename,
|
||||
const int aFlags = SQLITE_OPEN_READONLY,
|
||||
const int aTimeoutMs = 0,
|
||||
const char* apVfs = NULL);
|
||||
const int aFlags = SQLITE_OPEN_READONLY,
|
||||
const int aBusyTimeoutMs = 0,
|
||||
const char* apVfs = NULL);
|
||||
|
||||
/**
|
||||
* @brief Open the provided database UTF-8 filename.
|
||||
@ -75,17 +75,17 @@ public:
|
||||
*
|
||||
* Exception is thrown in case of error, then the Database object is NOT constructed.
|
||||
*
|
||||
* @param[in] aFilename UTF-8 path/uri to the database file ("filename" sqlite3 parameter)
|
||||
* @param[in] aFlags SQLITE_OPEN_READONLY/SQLITE_OPEN_READWRITE/SQLITE_OPEN_CREATE...
|
||||
* @param[in] aTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY (see setBusyTimeout())
|
||||
* @param[in] aVfs UTF-8 name of custom VFS to use, or empty string for sqlite3 default
|
||||
* @param[in] aFilename UTF-8 path/uri to the database file ("filename" sqlite3 parameter)
|
||||
* @param[in] aFlags SQLITE_OPEN_READONLY/SQLITE_OPEN_READWRITE/SQLITE_OPEN_CREATE...
|
||||
* @param[in] aBusyTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY (see setBusyTimeout())
|
||||
* @param[in] aVfs UTF-8 name of custom VFS to use, or empty string for sqlite3 default
|
||||
*
|
||||
* @throw SQLite::Exception in case of error
|
||||
*/
|
||||
Database(const std::string& aFilename,
|
||||
const int aFlags = SQLITE_OPEN_READONLY,
|
||||
const int aTimeoutMs = 0,
|
||||
const std::string& aVfs = "");
|
||||
const int aFlags = SQLITE_OPEN_READONLY,
|
||||
const int aBusyTimeoutMs = 0,
|
||||
const std::string& aVfs = "");
|
||||
|
||||
/**
|
||||
* @brief Close the SQLite database connection.
|
||||
@ -106,11 +106,11 @@ public:
|
||||
* Reading the value of timeout for current connection can be done with SQL query "PRAGMA busy_timeout;".
|
||||
* Default busy timeout is 0ms.
|
||||
*
|
||||
* @param[in] aTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY
|
||||
* @param[in] aBusyTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY
|
||||
*
|
||||
* @throw SQLite::Exception in case of error
|
||||
*/
|
||||
void setBusyTimeout(const int aTimeoutMs) noexcept; // nothrow
|
||||
void setBusyTimeout(const int aBusyTimeoutMs) noexcept; // nothrow
|
||||
|
||||
/**
|
||||
* @brief Shortcut to execute one or multiple statements without results.
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* Include this main header file in your project to gain access to all functionality provided by the wrapper.
|
||||
*
|
||||
* Copyright (c) 2012-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
* Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
*
|
||||
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
* or copy at http://opensource.org/licenses/MIT)
|
||||
@ -38,5 +38,5 @@
|
||||
* with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
|
||||
* numbers used in [SQLITECPP_VERSION].
|
||||
*/
|
||||
#define SQLITECPP_VERSION "0.9.9"
|
||||
#define SQLITECPP_VERSION_NUMBER 0009009
|
||||
#define SQLITECPP_VERSION "1.0.0"
|
||||
#define SQLITECPP_VERSION_NUMBER 1000000
|
||||
|
@ -1,6 +1,6 @@
|
||||
# CMake file for compiling the sqlite3 static library under Windows (for ease of use)
|
||||
#
|
||||
# Copyright (c) 2013-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
# Copyright (c) 2013-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
#
|
||||
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
# or copy at http://opensource.org/licenses/MIT)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @ingroup SQLiteCpp
|
||||
* @brief Encapsulation of a Column in a row of the result pointed by the prepared SQLite::Statement.
|
||||
*
|
||||
* Copyright (c) 2012-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
* Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
*
|
||||
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
* or copy at http://opensource.org/licenses/MIT)
|
||||
|
@ -27,9 +27,9 @@ namespace SQLite
|
||||
|
||||
// Open the provided database UTF-8 filename with SQLITE_OPEN_xxx provided flags.
|
||||
Database::Database(const char* apFilename,
|
||||
const int aFlags /* = SQLITE_OPEN_READONLY*/,
|
||||
const int aTimeoutMs /* = 0 */,
|
||||
const char* apVfs /* = NULL*/) :
|
||||
const int aFlags /* = SQLITE_OPEN_READONLY*/,
|
||||
const int aBusyTimeoutMs /* = 0 */,
|
||||
const char* apVfs /* = NULL*/) :
|
||||
mpSQLite(NULL),
|
||||
mFilename(apFilename)
|
||||
{
|
||||
@ -41,17 +41,17 @@ Database::Database(const char* apFilename,
|
||||
throw SQLite::Exception(strerr);
|
||||
}
|
||||
|
||||
if (aTimeoutMs > 0)
|
||||
if (aBusyTimeoutMs > 0)
|
||||
{
|
||||
setBusyTimeout(aTimeoutMs);
|
||||
setBusyTimeout(aBusyTimeoutMs);
|
||||
}
|
||||
}
|
||||
|
||||
// Open the provided database UTF-8 filename with SQLITE_OPEN_xxx provided flags.
|
||||
Database::Database(const std::string& aFilename,
|
||||
const int aFlags /* = SQLITE_OPEN_READONLY*/,
|
||||
const int aTimeoutMs /* = 0 */,
|
||||
const std::string& aVfs /* = "" */) :
|
||||
const int aFlags /* = SQLITE_OPEN_READONLY*/,
|
||||
const int aBusyTimeoutMs /* = 0 */,
|
||||
const std::string& aVfs /* = "" */) :
|
||||
mpSQLite(NULL),
|
||||
mFilename(aFilename)
|
||||
{
|
||||
@ -63,9 +63,9 @@ Database::Database(const std::string& aFilename,
|
||||
throw SQLite::Exception(strerr);
|
||||
}
|
||||
|
||||
if (aTimeoutMs > 0)
|
||||
if (aBusyTimeoutMs > 0)
|
||||
{
|
||||
setBusyTimeout(aTimeoutMs);
|
||||
setBusyTimeout(aBusyTimeoutMs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,13 +86,13 @@ Database::~Database() noexcept // nothrow
|
||||
* Reading the value of timeout for current connection can be done with SQL query "PRAGMA busy_timeout;".
|
||||
* Default busy timeout is 0ms.
|
||||
*
|
||||
* @param[in] aTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY
|
||||
* @param[in] aBusyTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY
|
||||
*
|
||||
* @throw SQLite::Exception in case of error
|
||||
*/
|
||||
void Database::setBusyTimeout(const int aTimeoutMs) noexcept // nothrow
|
||||
void Database::setBusyTimeout(const int aBusyTimeoutMs) noexcept // nothrow
|
||||
{
|
||||
const int ret = sqlite3_busy_timeout(mpSQLite, aTimeoutMs);
|
||||
const int ret = sqlite3_busy_timeout(mpSQLite, aBusyTimeoutMs);
|
||||
check(ret);
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ Transaction::~Transaction() noexcept // nothrow
|
||||
catch (SQLite::Exception& e)
|
||||
{
|
||||
// Never throw an exception in a destructor
|
||||
(void)e; // warning proof
|
||||
SQLITECPP_ASSERT(false, e.what()); // See SQLITECPP_ENABLE_ASSERT_HANDLER
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace SQLite
|
||||
/// definition of the assertion handler enabled when SQLITECPP_ENABLE_ASSERT_HANDLER is defined in the project (CMakeList.txt)
|
||||
void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg)
|
||||
{
|
||||
// TODO: test that this assertion callback get called
|
||||
// TODO: unit test that this assertion callback get called (already tested manually)
|
||||
std::cout << "assertion_failed(" << apFile << ", " << apLine << ", " << apFunc << ", " << apExpr << ", " << apMsg << ")\n";
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ TEST(Statement, invalid) {
|
||||
EXPECT_THROW(query.exec(), SQLite::Exception); // exec() shall throw as it does not expect a result
|
||||
}
|
||||
|
||||
// TODO: test every kind of binding
|
||||
// TODO: test every kind of binding + clearBindings()
|
||||
|
||||
TEST(Statement, getColumnByName) {
|
||||
// Create a new database
|
||||
|
Loading…
x
Reference in New Issue
Block a user