85 Commits

Author SHA1 Message Date
Kacperos155
be5400ca99 Small improvements & code cleanup 2022-07-23 16:07:53 +02:00
Sébastien Rombauts
64c34bc7bd Added unit tests for new getChanges() and fix comment being too long 2021-07-25 10:46:56 +02:00
Sébastien Rombauts
ca7c0e5f1a Added Database and Statement method getChanges()
Fix #331 How to get the number of updated/deleted rows?

Fix cpplint warnings about line size with a NOLINT comment when better to keep oneline
2021-07-25 10:46:56 +02:00
Sébastien Rombauts
f6b32259f2 Fix build with system provided lib older than SQlite 3.31.0 from 2020-01-22 2021-01-18 13:05:56 +01:00
Sébastien Rombauts
e779e68c78
Merge pull request #305 Add other constants that work with sqlite3_open_v2 from LuAPi/more-flags 2021-01-18 12:35:53 +01:00
Sébastien Rombauts
845f315ab3
Merge pull request #311 Add Database::tryExec() from kcowolf/master 2020-11-25 17:25:30 +01:00
Benjamin Stauffer
1d0d8fe446 Add Database::tryExec()
Similar to Statement::tryExecuteStep(), allows calls to sqlite3_exec()
with the caller assuming responsibility for checking and handling the
returned status.
2020-11-12 02:05:05 -06:00
Ben Stauffer
0ae04a60d9 Fix build warning due to string truncation
strncpy gives an "output may be truncated" warning in newer versions of
GCC due to *pBuf being larger (100) than *pHeaderStr (16).  Use memcpy
and explicitly null-terminate the target string.
2020-11-09 17:13:50 -06:00
Luke Pitt
503afc396c Add other constants that work with sqlite3_open_v2 2020-10-08 12:48:42 +01:00
Tomas
8ecadfd629 Add SQLITE_OPEN_FULLMUTEX flag 2020-06-04 14:45:47 +02:00
Sébastien Rombauts
eadd166d75 Fix a warning testing return of strncmp 2020-01-12 22:05:53 +01:00
Sébastien Rombauts
55de873f66 Fix Database::getHeaderInfo() for case where the file is not even 100 bytes long 2020-01-04 18:54:27 +01:00
Sébastien Rombauts
9ea0cffc15 Replace Database::backup() "C" implementation by calling the Backup class 2020-01-03 22:58:42 +01:00
Sébastien Rombauts
92ff87be60 Conversion of sqlite3* Database::mpSQLite to a std::unique_ptr with a custom Deleter
I might switch to a std::shared_ptr to share it with Statement objects if more appropriate
2020-01-03 22:56:13 +01:00
Sébastien Rombauts
da4d692c13 Start a new 3.x branch requiring C++11 and CMake 3.1
- Remove support for Visual Studio < 2015
- Remove Statement::isOk() deprecated in 2.2.0 and renamed to Statement::hasRow()
2020-01-02 00:04:06 +01:00
Sébastien Rombauts
e6288ee920 Update copyright notice 2020-01-01 08:08:59 +01:00
Patrick Servello
b5c0a08d3d Added SQLite header parsing functionality and associated tests (#249)
* Added SQLite header parsing functionality and associated tests

* Removed unused header file.

* Removed an accidental copy pasted remove() statement

* Replaced stdint with plain old C types for now. Will apply fixed with datatypes to cpp11 branch

* Added test scenarios to simulate blank file name, non existant file and a corrupt header

* Refactored exception flow to match latest tidying, brought casts out of function calls and cleared up invalid header exception message
2019-12-30 13:45:51 +01:00
Sébastien Rombauts
ae01dfb895 Minor cleanup on throwing exception in Database 2019-12-29 22:24:07 +01:00
Sébastien Rombauts
dc3f1ac271 Add unit test for Database::createFunction()
using an example from
https://stackoverflow.com/a/8283265/1163698 How can I create a user-defined function in SQLite?
2019-12-29 22:22:10 +01:00
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
1eda5c751c Minor cleanup of the codebase, mostly putting braces on their own line in unit tests 2019-06-16 15:48:57 +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
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
fekir
db156e6282 Remove noexcept from setBusyTimeout since it may throw (it is also documented) 2017-08-18 20:20:55 +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
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