160 Commits

Author SHA1 Message Date
Jorrit Wronski
f5a25167a4 Debugging GCC build errors remotely is not fun... 2016-12-23 14:16:37 +01:00
Jorrit Wronski
a7d5ea4c2b Trying to gcc happy 2016-12-23 14:06:36 +01:00
Jorrit Wronski
823828fc9e Made encryption test static and fixed the encryption docs 2016-12-23 13:52:59 +01:00
Jorrit Wronski
02f8fe19c0 Fixed some documentation and corrected the encryption detection. 2016-12-23 08:02:13 +01:00
Jorrit Wronski
685ff293c5 moved the key handling to a new function, added a check for an encrypted database 2016-12-22 17:52:06 +01:00
Jorrit Wronski
611ab22458 Added ability to open encrypted databases. 2016-12-01 23:37:22 +01:00
Mikhail Komarov
51885d7aa6 Redundant const specifier removed 2016-09-09 13:31:36 +03:00
Jens Alfke
30e285ff89 Fixed link errors calling Exception::getErrorCode()
getErrorCode() and getExtendedErrorCode()'s implementations were
accidentally declared as inline in the .cpp file. This causes the
compiler to not generate any code for them, resulting in link errors
when a client calls them.

Fixed by moving the implementations into the header, where they need to
be if they're inline.
2016-08-04 16:36:09 -07:00
Sébastien Rombauts
da725ed1cf Fix compiler warning (unused variable) 2016-07-26 17:44:24 +02:00
Sébastien Rombauts
2b384d1441 Fix #94 warning: "'extern' variable has an initializer" 2016-07-26 07:39:35 +02:00
Sébastien Rombauts
648ffe01e8 Add Database::VERSION, getLibVersion() and getLibVersionNumber()
Usefull to get SQLite3 version without including sqlite3.h in application code
2016-07-25 21:53:47 +02:00
Sébastien Rombauts
f77b707206 Revert recent switch from uint32_t/int64_t to use int/unsigned/long/long long and fix #93 2016-07-19 10:56:08 +02:00
Sébastien Rombauts
7983b81f75 Mutualize code between getColumn(name) and isColumnNull(name) with a getColumnIndex(name)
- mColumnNames is mutable so that getColumnIndex() and isColumnNull() can be const
2016-07-16 16:33:44 +02:00
Bruno Coelho
f022c6af60 Add option to check if column is null by name 2016-07-15 16:15:34 +01:00
Sébastien Rombauts
401b7361ed Renamed errmsg() and getErrStr() methods to getErrorMsg() and getErrorStr() 2016-07-13 18:37:22 +02:00
Sébastien Rombauts
91abc3cb44 Remove unused Exception constructor 2016-07-13 18:32:44 +02:00
Sébastien Rombauts
fd8f50bdd9 Remove last #include <sqlite3.h> from a header : add a few public constants
- Move #include <sqlite3.h> from Exception.h to a new corresponding .cpp
 - Add SQLite::OPEN_READONLY...
2016-07-13 17:16:41 +02:00
Sébastien Rombauts
fb5508921a Move #include <sqlite3.h> from Database.h to the .cpp 2016-07-08 17:07:59 +02:00
Sébastien Rombauts
8275c7fb29 Move #include <sqlite3.h> from Statement.h to the .cpp 2016-07-07 08:43:32 +02:00
Sébastien Rombauts
2abcf45bb9 Remove Column::errmsg() method : use Database or Statement equivalents 2016-07-06 21:41:04 +02:00
Sébastien Rombauts
300f278281 Move #include <sqlite3.h> from Column.h to the .cpp 2016-07-06 21:20:19 +02:00
Sébastien Rombauts
b033abb3fd Add unit tests for the new Column getter and cast operator 2016-07-06 21:20:19 +02:00
Sébastien Rombauts
646d25ca95 Switch from sqlite3_int64 to int64_t 2016-07-05 11:05:16 +02:00
Sébastien Rombauts
db7aefb271 Renamed Backup accessors and use a forward declaration to sqlite3_backup 2016-07-05 07:49:38 +02:00
Sébastien Rombauts
9c03f4e86b Add bindNoCopy() for C-style null-terminated text strings 2016-07-03 16:55:27 +02:00
Sébastien Rombauts
e7384b30a8 Remove unfinished Statement move constructor from PR #86
- see comments in code: needs a move constructor on Statement::Ptr
2016-07-02 14:14:08 +02:00
Sébastien Rombauts
bcdbea2cf8 Style cleanup on top of PR #86 2016-07-02 14:11:02 +02:00
Douglas Heriot
9a07f3918d Fix build on Linux, including cpplint warnings. 2016-07-02 14:05:14 +02:00
Douglas Heriot
a84c04aada Add bindNoCopy methods to allow binding std::string with SQLITE_STATIC.
Should be safe, as long as you can guarantee the std::string exists while executing the query.

Added an accessor to Column that returns a std::string, that can handle BLOB or TEXT values that contain null-bytes.

Also more binding & Column cast support for uint32_t - fixes ambiguous overload errors when using unsigned-integer types.
Note that I didn't use uint64_t, because unsigned 64-bit integers doesn't fit into SQLite (except for using int64_t and dealing with overflow with custom functions).

Added a C++11 move constructor to Statement, to allow storing it inside STL containers (eg. vector).
2016-07-02 14:05:14 +02:00
Sébastien Rombauts
0cdb40d614 Use the new SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION from SQLite 3.13 for security reason 2016-06-30 21:48:40 +02:00
Sébastien Rombauts
0c43747065 Add unit tests for statement bindings + removed an assert() for ~Transaction() 2016-06-30 11:35:28 +02:00
Sébastien Rombauts
69d9b0805c Minor new unit tests for backups and database busy timeout 2016-06-27 13:10:09 +02:00
Sébastien Rombauts
90699f95ea Cleanup post merge request #84 : one more exception constructor 2016-06-27 11:34:25 +02:00
Douglas Heriot
2cd31179f4 Use new Exception constructors everywhere appropriate.
Fix compiling with C++11.
Added public assessor methods to Exception class.
Added more Exception constructors as needed.
2016-05-26 12:34:14 +10:00
Douglas Heriot
832e89440f Better exception messages when statements fail
Added new constructor to Exception that takes sqlite3* pointer, allowing for getting more information out. Makes it much easier to debug syntax errors in prepared statements, for example.
2016-05-26 00:34:34 +10:00
Sébastien Rombauts
c53d885393 Update copyright notice to 2016 2016-02-10 10:27:47 +01:00
Sébastien Rombauts
b7b440de5d Fix #73 Wrong exception thrown by Database constructor
- switched from sqlite3_errmsg() to sqlite3_errstr() where applicable
2015-11-10 18:32:24 +01:00
hongshibao
e8f956be22 Add Backup test 2015-10-28 03:04:13 +08:00
hongshibao
08716b8938 Add comments 2015-10-28 02:01:32 +08:00
hongshibao
c9dcf64cd0 Add throw exception case in executeStep
Add Comments
2015-10-26 00:35:36 +08:00
hongshibao
05d304b7c9 add Backup class 2015-10-25 18:31:16 +08:00
Sébastien Rombauts
d36c39ccf3 Fix CppDepends most useful warnings:
- Convert last old-style cast to reinterpret_cast<>
 - Statement::Ptr is now private, with a friend declaration for Column
 - noexcept should not be defined as the depreacted throw()
2015-06-01 22:05:24 +02:00
Aurelien ALBERT
5a8a6e243e Removed a warning in release build with Visual Studio 2015-05-21 10:52:46 +02:00
ncr
99db2f8bdb Added conditional support for extension loading 2015-05-16 17:42:45 +03:00
Richard Jones
368049a613 Added support for extension loading 2015-05-08 09:47:12 +01:00
Sébastien Rombauts
318f742b5c Revert use sqlite_errstr instead of sqlite3_errmsg that fixed #48
- sqlite3_errstr() is new from SQLite v3.7.15, not supported on Ubuntu 12.04
   which is what is used for continuous integration with Travis CI
 - Only case of error is SQLITE_BUSY: "database is locked" (some statements are not finalized)
   so use this generic string instead
2015-05-06 09:36:15 +02:00
Onur Aslan
e55fffefd7 Use sqlite_errstr instead of sqlite3_errmsg
mpSQLite is free'd with sqlite3_close. It's no more accesible.
Fixes: #48
2015-05-06 00:22:43 +03:00
Sébastien Rombauts
09db07ccc7 Updated version to 1.0.0 changelog and copyright date 2015-05-03 23:32:57 +02:00
Sébastien Rombauts
e537195625 Fix #47 setBusyTimeout in constructor
- add corresponding Unit Test
2015-05-03 23:32:50 +02:00
Sébastien Rombauts
3c39f1ff1c Fix 3 new cpplint warnings about max line size 2015-05-03 23:32:40 +02:00