Despite previously assumed and tested, most of the databases support
storing the various unsigned integer values. The checks for it in the
tests are therefore obsolete.
Only Firebird and SQLite seem to have a problem with storing UINT64_MAX.
The retrieval of it in a sorted result set with multiple other values
shows that the value is stored as a signed integer in the database.
The older read(...) and write(...) function, which take backend-specific
offsets rather than uniformly taken 0-based offsets (as is the case for
the *_from_start(...) functions), are now implemented in terms of their
*_from_start counterpart.
All test cases have been adapted to now prefer using the *_from_start
functions over the old counterparts.
Return the ID used for the given table instead of the last ID inserted
in any database table, which could be very different.
This relies on using internal sqlite_sequence table that is used by
AUTOINCREMENT.
Co-authored-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Closes#971.
Allow enabling foreign key checking, which is disabled by default in the
current SQLite versions, for the applications that need it using the
appropriate SQLite pragma if the corresponding connection string
parameter is specified.
Closes#968.
SQLite doesn't have any specific XML support, but it can still be stored
in normal TEXT columns, which is better than not supporting it at all.
Closes#966.
Don't redefine the same variables in a couple of tests.
In other places, use artificially different names to avoid clashes with
the existing variables in outer scope.
No real changes.
Ignore spaces when checking for known column types. This allows to use
either "BIG INT" or "BIGINT" and also makes the previously broken
"UNSIGNED BIG INT" work too.
Closes#783, #785.
MSVC++ 1900+ always compile with C++11 mode enabled, so it should be
safe to selectively enable 'override'specifier for internal use.
It does not enable all C++11 features for SOCI and we still compile
with C++11 compilation mode SOCI_CXX_C11=OFF by default.
Refactoring performed with clang-tidy-4.0:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSOCI_CXX_C11=ON ..
run-clang-tidy.py -clang-tidy-binary -header-filter='.*' \
-checks='-*,modernize-use-modernize' -fix
Oracle historically treats empty VARCHAR[2] column values as nulls, so
we need to adjust the string length unit test to provide indicators when
retrieving the value of a possibly null string and use nvl() to compute
its length to make this test pass when using this backend.
Use the new CHECK_EQUAL_PADDED() macro instead of just CHECK() for the CHAR(N)
fields as they can be padded, and even padded incorrectly, by some backends.
Add a new test verifying that, up to padding, CHAR(N) fields do behave
correctly.
Closes#356.
This should solve compilation errors on OSX where struct session defined in
global namespace in /usr/include/sys/proc.h conflicts with unqualified uses of
soci::session.
Fixes#340
This should solve compilation errors on OSX where struct session defined in
global namespace in /usr/include/sys/proc.h conflicts with unqualified uses of
soci::session.
Fixes#340
"assert" in the name of the directory doesn't make any sense any more as we
don't use asserts in the test code now that we use CATCH.
Also extend the tests description in the README.md.