261 Commits

Author SHA1 Message Date
Sébastien Rombauts
7dbcf482f2 Update copyright notice to 2023 2023-05-24 18:49:55 +02:00
Sébastien Rombauts
cf3b75063b Minor code formating changes & comments 2023-05-24 18:49:40 +02:00
Jonathan Guzmán
6bdad41ce8
do not add SQLITECPP_API to cpp variables 2023-04-01 13:44:44 -06:00
Pierre Proske
2f00790811 Rename DLL_API to SQLITECPP_API, and add visibility attribute for gcc 2023-02-14 13:07:55 +11:00
Pierre Proske
14cba69a33 Now working with example 2023-02-06 19:43:35 +11:00
Jonathan Guzmán
1841e6b66f
add disable option for sqlite3_expanded_sql
make sqlite3_expanded_sql use optional and give a warning at compile time
along with a exception at runtime when used in an application
2022-12-19 19:18:31 -06:00
Sébastien Rombauts
cc0044a603 Add a Transaction::rollback() method 2022-12-15 19:00:04 +01:00
Sébastien Rombauts
ce9699decf Rename Savepoint::rollback() to Savepoint::rollbackTo() 2022-12-15 13:41:49 +01:00
Sébastien Rombauts
4a9cc0adce Fix Savepoint comments and file formatting
Improved Savepoint description, it was mostly copy-pasted from Transaction with missing bits of information
Conform to the SQLiteCpp code style, mainly braces have to be located on their own line
2022-12-15 13:30:19 +01:00
Sébastien Rombauts
343299a31d
Merge pull request #390 fix incorrect work of savepoint from spoyler/save_point
Fix #381
2022-12-15 13:12:10 +01:00
Jonathan Guzmán
d4ff61fd2e
check if SQLITE_OPEN_NOFOLLOW is defined
under MacOS 11 BigSur(macos-latest) the macro SQLITE_OPEN_NOFOLLOW
is not defined so it may cause compilation issues for those versions
2022-12-13 19:37:17 -06:00
Сидоров Андрей Алексеевич
1a63044624 Add release for savepoint after rollabck in destructor for deleting it form sqlite transaction stack. 2022-12-12 12:35:34 +03:00
Doug Nazar
77fc1f30b2 Ensure that TEXT column is UTF-8 encoded before using sqlite3_column_blob()
If the database is in a different format (ie. UTF-16) the memory that
sqlite3_column_blob() will point to by default will be the native (UTF-16)
encoding. Calling sqlite3_column_bytes() will basically be a noop for
a BLOB or a TEXT already in UTF-8. Otherwise it'll convert to TEXT w/UTF-8.

Run the 'basis' tests against both a UTF-8 and a UTF-16 database.
Reset & rerun query between tests blocks to reset column types.
Reorder a few getText()/getString() operations to ensure we test both ordering.
Don't try to convert random blob to TEXT. Will fail encoding conversion.
2022-12-02 14:03:03 -05:00
bielow
d416b40583 extend on reset() vs clearBindings() 2022-11-21 22:51:35 +01:00
bielow
56d5be9878 remove duplicate docs (avoid warning : argument 'aBusyTimeoutMs' from the argument list of SQLite::Database::setBusyTimeout has multiple @param documentation sections) 2022-11-21 21:48:23 +01:00
Sébastien Rombauts
ffe155c4b8 Copyright notice 2022 2022-09-18 15:25:14 +02:00
Kacperos155
cdafab0024 Small improvements & code cleanup
# Re-introduce the unique_ptr with custom deleter needed to avoid including sqlite.h in Backup.h
2022-09-18 14:51:32 +02:00
Sébastien Rombauts
f70c9f7a7b Fix compilation: Revert "Use transparent comparator in mColumnNames to avoid creating std::string when comparing" 2022-09-18 14:26:41 +02:00
Sébastien Rombauts
c7cffad617
Merge pull request #360 from Kacperos155/small_improvements
Small improvements and code cleaning
2022-09-18 14:16:54 +02:00
Sébastien Rombauts
3d149cc62f Removal of removing long APIs 2022-07-24 22:03:55 +02:00
Kacperos155
d9f8be8326 Merge branch 'small_improvements' of https://github.com/Kacperos155/SQLiteCpp into small_improvements 2022-07-24 19:11:43 +02:00
Kacperos155
accceeecb9 Restore Backup destructor & small style changes 2022-07-24 19:07:03 +02:00
Kacperos155
04a4c2e8ef Use transparent comparator in mColumnNames to avoid creating std::string when comparing 2022-07-24 19:07:03 +02:00
Kacperos155
d9e5a74773 Small improvements & code cleanup 2022-07-24 19:05:53 +02:00
Kacperos155
e576abaf7c Restore Backup destructor & small style changes 2022-07-24 18:54:00 +02:00
Kacperos155
29e9f31c89 Use transparent comparator in mColumnNames to avoid creating std::string when comparing 2022-07-23 16:12:44 +02:00
Kacperos155
be5400ca99 Small improvements & code cleanup 2022-07-23 16:07:53 +02:00
Kacperos155
c5b3aa83a2 Restored Statement move constructor for compatibility with older compilers 2022-01-26 04:44:47 +01:00
Kacperos155
27a32521b7 Add test for Column std::shared_ptr; remove noexcept from throwing Column constructor 2022-01-26 04:19:10 +01:00
Kacperos155
10d779a349 Fixed #349; Column throw when constructed with nullptr 2022-01-26 03:22:17 +01:00
Kacperos155
354323a875 Minor refactoring to Statement and Column 2022-01-25 20:56:48 +01:00
Kacperos155
2800b65ac6 Set Statement move constractor to default; fix #347 2022-01-25 20:32:40 +01:00
Kacperos155
6da299db12 Replace Statement::Ptr with std::shared_ptr 2022-01-25 19:13:02 +01:00
Kacperos155
edf49ee141 Long size checks replaced with fixed width ints 2022-01-25 13:28:51 +01:00
Sébastien Rombauts
beb2b29640 Update copyright to 2021 2021-10-06 18:40:51 +02:00
John Jenkins
abd139c597 Allow specifying transaction behaviors DEFERRED, IMMEDIATE, and EXCLUSIVE 2021-10-04 16:27:08 -05: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
cac0000ada Merge #299 Added Savepoint support from catalogm 2021-01-06 11:07:44 +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
Kelvin Hammond
ee6762c0d9 Added: Savepoint support 2020-09-10 18:59:08 -04:00
Tomas
8ecadfd629 Add SQLITE_OPEN_FULLMUTEX flag 2020-06-04 14:45:47 +02:00
Daniel Schmidt
0c9d4a3f36 Improved name of new function, documentation and tests. 2020-03-26 09:19:27 +01:00
Daniel Schmidt
98aff92081 Implemented getDeclaredType with documentation. 2020-03-16 15:26:30 +01:00
Sébastien Rombauts
eadd166d75 Fix a warning testing return of strncmp 2020-01-12 22:05:53 +01:00