198 Commits

Author SHA1 Message Date
Sébastien Rombauts
c1ab7075f4 Fix compilation of new enum Database::BackupType for C++98 2019-07-09 09:37:05 +02:00
Oleg Smolsky
514d7d6846 Implement Database::backup() (#211)
Easily backup/restore a live DB via the sqlite3_backup_init() API
 - https://www.sqlite.org/backup.html
 - https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit

Use the reference implementation from the documentation
2019-07-09 09:35:31 +02:00
Sébastien Rombauts
49c1f6c08d Rename Statement::getExpandedSQL() from #201 and fix #203 #205 memory leak 2019-06-24 22:01:54 +02:00
Sébastien Rombauts
9b00034b06
Merge pull request #201 from os12/master
Add Statement::getExtendedSQL()
2019-06-18 20:24:33 +02:00
Sébastien Rombauts
1eda5c751c Minor cleanup of the codebase, mostly putting braces on their own line in unit tests 2019-06-16 15:48:57 +02:00
Oleg Smolsky
ce45099695 Add Statement::getExtendedSQL()
- it returns a UTF-8 string containing the SQL text of prepared statement with
   bound parameters expanded
2019-06-15 10:27:30 -07:00
maxbachmann
7738989228
Update Statement.cpp 2019-05-21 17:51:56 +02:00
Sébastien Rombauts
50425142fe Fix Statement destructor since addition of the move constructor 2019-03-05 07:15:06 +01:00
Sébastien Rombauts
f2b1017710 Add a Statement::Ptr move constructor to fix leak because of ref counter incremented on copy 2019-03-05 00:20:06 +01:00
Sébastien Rombauts
f1301a4a11
Merge pull request #192 from jrave/bind_parameter_count
Add wrapper for bind parameter count
2019-03-04 20:18:49 +01:00
Sébastien Rombauts
78915c8f43 Fix #190 Add Statement move constructor 2019-03-04 18:43:59 +01:00
Johannes Rave
1dab172264 Add wrapper for bind parameter count 2019-03-04 18:43:32 +02:00
Sébastien Rombauts
2cb3cb2fef Update copyright notice 2019-03-02 15:46:53 +01:00
Sébastien Rombauts
d020c5f694 Update copyright notices to 2018 2018-01-24 11:26:38 +01:00
Sébastien Rombauts
b4a932e48a sqlite3_db_config() not using nullptr: cannot pass object of non-POD type 'std::__1::nullptr_t' through variadic function 2017-12-20 15:37:37 +01:00
Sébastien Rombauts
86985dfd1f Fix nullptr detection with AppleClang 2017-12-17 21:42:23 +01:00
Sébastien Rombauts
4f32da182c Add my Utils.h file to define nullptr on C++98 and C++03 compilers 2017-12-13 10:34:55 +01:00
Sébastien Rombauts
4f7899c959 Rename Statement::mbIsOk to mbHasRow 2017-08-28 17:17:18 +02:00
Sébastien Rombauts
c14d884ba5 Mutualize code into tryExecuteStep() from PR #142 using SQLITE_MISUSE when statement needs to be reseted 2017-08-28 17:10:38 +02:00
Sébastien Rombauts
94c7897d1b Cleanup on PR #142 : remove whitespaces and mutualize some code 2017-08-28 16:00:50 +02:00
Henrik Jakobsson Majava
8191046ea5 Added tryExecuteStep and tryReset 2017-08-28 11:00:17 +02:00
Sébastien Rombauts
5479cc09bf Merge pull request #139 from fekir/clean_destructors
Remove unnecessary noexcept identifier from destructors
2017-08-22 11:07:03 +02:00
fekir
1fd32277c1 Remove unnecessary noexcept identifier from destructors 2017-08-21 22:01:21 +02:00
Sébastien Rombauts
926ebdab8f Merge pull request #137 from fekir/remove_noexcept
Remove noexcept
2017-08-21 11:12:16 +02:00
Sébastien Rombauts
9c15cf7c98 Merge pull request #136 from fekir/fix_stream
Ensure that operator<< correctly prints strings with embedded '\0'
2017-08-21 11:10:57 +02:00
Sébastien Rombauts
3c3b23a712 Merge pull request #134 from drivehappy/master
Warning cleanup under MSVC and Clang
2017-08-21 11:08:35 +02:00
fekir
67ac88fb1e Add SQLite::Exception constructor that takes const char* in order to avoid possible std::bad_alloc exception
std::runtime_error provides such overload in c++11, therefore it will make no difference when compiling for c++03, but should provide no harm either
2017-08-19 08:59:57 +02:00
fekir
db156e6282 Remove noexcept from setBusyTimeout since it may throw (it is also documented) 2017-08-18 20:20:55 +02:00
fekir
697929cfbe Remove noexcept since std::string constructor may throw 2017-08-18 20:20:29 +02:00
fekir
21ead7c5a4 Ensure that operator<< correctly prints strings with embedded '\0' 2017-08-18 18:24:10 +02:00
drivehappy
d39ff3475e Fixing tab indentation to use spaces. 2017-08-03 15:36:26 -07:00
drivehappy
6adc4cd5a8 Fixing unused parameter warning under Clang. 2017-08-03 13:34:16 -07:00
drivehappy
218aca1b13 Fixing warning under MSVC. 2017-08-03 13:33:08 -07:00
Timothy Rae
400ab71fa3 Fix unused parameter warning 2017-03-31 12:22:48 +09:00
Timothy Rae
4c339031f0 Remove const from Database::isUnencrypted() return type
Compiling with gcc pedantic mode was leading to a warning: "type qualifiers ignored on function return type"
2017-03-31 12:12:46 +09:00
Jorrit Wronski
dbd31fb56b Fixed some compiler warnings 2016-12-23 14:57:09 +01:00
Jorrit Wronski
d26bd2cb8a Added tests for the encrypted database 2016-12-23 14:54:02 +01:00
Jorrit Wronski
498525bb26 Final modifications for cpplint and gcc 2016-12-23 14:20:54 +01:00
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