Avoid giving the summary and again and again and again when rerunning
CMake due to some change in CMakeLists.txt: this is especially important
when using the library via add_subdirectory() and the change happens in
some files not related to SOCI at all.
Map error 25006 ("cannot execute INSERT in a read-only transaction")
to "no_privilege" category as this means that the database is in
read-only mode, i.e. we don't have the privileges for changing it.
Not only the compiler seems to give this warning for just a simple
unconditional "throw", but it also has started giving it in a previously
warning-free code, probably due to a micro version update on GitHub CI.
Fighting against is becoming really ridiculous, so just suppress the
warning globally and remove the local suppressions for it which are not
needed any more.
This was inconsistent with the other statement-like macros in SOCI
itself and globally unusual.
Add semicolons to a couple of places where they were not used (they
already were in a couple of other ones).
No real changes.
In addition to providing fallback implementation of this option under
Windows, also do it under Linux when using libpq < 12, where this option
was added.
This allows to always specify this option in the connection string,
without worrying about it resulting in fatal error from PQconnectdb() on
older systems: in the worst case, the option is ignored and when using
Linux (or any other system with TCP_USER_TIMEOUT support, although none
seem to currently exist) it will work in the same way as in libpq.
Fix wrong SOCI_POSTGRESQL_NO_LO64 definition kind: it must be used for
compiling the backend itself and doesn't have to be defined when
compiling code using it, so change it from INTERFACE to PRIVATE.
This actually used to be correct before but was broken in 0d85e899
(First draft of new cmake, 2024-01-03).
Debug builds seem to take much less time than the release ones, so
switch MSVS 2019 job to debug too.
Don't define the configuration globally now that there is no default
value, with half of the builds using debug and half release.
As we can't specialize exchange_traits<> for both int8_t and char when
they are the same type (which is the case under Solaris, see #1154),
specialize exchange_traits<> for some wrapper type in this case to avoid
compilation errors.
This is an alternative, and simpler, solution than that of #1170, so we
can now remove soci_are_types_same CMake function.
This should have been part of the parent 185feedb (Remove
SOCI_INT64_T_IS_LONG and the test for it in CMake, 2025-06-12) which
forgot to replace the types inside type_conversion<> specializations for
soci_l_or_ll_t and its unsigned equivalent with these types.
See #1277.
This compiler gives a number of completely bogus warnings about
"unreachable code" in Release build, it's not worth dealing with them,
so try to avoid them by building in Debug instead.
Revert one of the changes of 10982080 (AppVeyor: Use Ninja for faster
builds, 2024-05-20) to make sure we still test the builds using MSBuild
somewhere, as GitHub Actions also use Ninja.
This build was removed in 6c39625d (Remove some builds from AppVeyor CI
to speed it up, 2025-06-07) but as long as we support this compiler, we
still need to test it somewhere, so add it back.
MSVS 2019 build is similar to GitHub MSVS 2022 build, so seems the least
likely to fail, assuming the other one (which finishes long before this
one) succeeds, so run it at the end and start with MinGW build which is
currently not being tested on GitHub CI.
We can replace preprocessor checks for SOCI_INT64_T_IS_LONG with simpler
logic if we assume that int64_t is always either "long" or "long long",
which seems to be true in practice, so do it and remove duplicated
specializations for "long" and "long long" in several places.
Avoid giving errors for negative or zero timeout value under Windows as
such values are ignored by libpq under Linux. Also handle small timeout
values as 1 under Windows, which seems better than just ignoring them.
Also extract this code into its own set_tcp_user_timeout() function for
clarity (this change is best viewed using Git --color-moved option).
This allows to use set_deallocate_prepared_statements(false)
temporarily, which makes it usable even in the long-running programs
which shouldn't let the resources accumulate on the server without ever
freeing them.
This is unnecessary as v12 implemented Ryu algorithm for floating point
number formatting which avoids precision loss by default, so don't run
an extra query on every connection in both PostgreSQL backend and ODBC
backend when using PostgreSQL driver.
This commit is best viewed ignoring whitespace-only changes.
Using this parameter allows to enable tracing of all database calls,
which can be useful for diagnostic and profiling purposes.
Also add fopen() wrapper to avoid "deprecation" warnings from MSVC.
libpq itself doesn't implement support for this parameter under Windows
(or anything other than Linux, actually), but it's possible to do it
relatively simply using TCP_MAXRT socket option there, so do it
ourselves in PostgreSQL session implementation.
This allows to confirm that tcp_user_timeout parameter works correctly
for PostgreSQL connections, as specifying different values for it
results in different elapsed time before the query fails.
This allows to confirm that tcp_user_timeout parameter works correctly
for PostgreSQL connections, as specifying different values for it
results in different elapsed time before the query fails.
Version is probably not very useful, but it is important to see at a
glance if SOCI is to be built as static or shared library.
Also move the status message about enabled backends to the end as well
to make it easier to find and appear even when re-configuring in the
same directory without any changes.