Commit Graph

3631 Commits

Author SHA1 Message Date
Vadim Zeitlin
4982b0e37b Merge branch 'cmake-affixes'
Add SOCI_NAME_PREFIX and SOCI_NAME_SUFFIX build options to allow using
custom prefix and/or suffix to distinguish custom SOCI builds.

See #1288.
2025-07-27 01:15:39 +02:00
Vadim Zeitlin
c6abf4ab83 Allow customizing SOCI shared libraries names
Add SOCI_NAME_PREFIX and SOCI_NAME_SUFFIX build options to allow using
custom prefix and/or suffix to distinguish custom SOCI builds.
2025-07-24 23:47:43 +02:00
Vadim Zeitlin
0d51b5067f Don't pip with sudo in Circle CI Python image
pip is installed for the normal user only and doesn't work (nor needs)
sudo.
2025-07-24 23:23:52 +02:00
Vadim Zeitlin
121c77a767 Use Circle CI Ruby image with Node
Node is required for this step (it's actually not clear if Ruby is).
2025-07-24 23:16:29 +02:00
Vadim Zeitlin
c49903c812 Update to supported versions of Circle CI images
Use newer "cimg" images instead of unsupported and not maintained since
years "circleci" ones.
2025-07-24 23:14:19 +02:00
Vadim Zeitlin
21e2ff016a Don't give build summary again if it hasn't changed
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.
2025-07-24 23:07:32 +02:00
Vadim Zeitlin
18b7ff2735 Update links to CMake documentation
Point to the latest version, not the ancient CMake 2.8 docs.

Also rephrase the descriptions a bit.
2025-07-24 23:06:45 +02:00
Vadim Zeitlin
6677f79225 Remove trailing newlines from Oracle error messages
Having these new lines in Oracle errors was unexpected as it as
inconsistent with the other backends and SOCI internal messages.
2025-07-24 23:06:45 +02:00
Vadim Zeitlin
602fc4b213 Fix a typo in a comment for connection_parameters::backendRef_
No real changes.
2025-07-24 23:06:45 +02:00
Vadim Zeitlin
a86de5a91f Recognize another PostgreSQL error as "no_privilege"
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.
2025-07-24 23:06:45 +02:00
Vadim Zeitlin
6728849259 Disable MSVC "unreachable code" warnings at CMake level
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.
2025-07-24 22:09:02 +02:00
Vadim Zeitlin
cbcd5529bb Disable Circle CI build workflow
It just doesn't want to work, so abandon the idea of adding a CI build
using Fedora for now.
2025-06-18 17:53:57 +02:00
Vadim Zeitlin
2868ee1d13 Fix setting SOCI_SOURCE_DIR
Also show the environment.
2025-06-18 17:49:54 +02:00
Vadim Zeitlin
5c47184253 Set SOCI_SOURCE_DIR in Circle CI configuration 2025-06-18 17:43:37 +02:00
Vadim Zeitlin
bd7c1f474c Use version 2.1 of Circle CI workflow
This is required to use "matrix" in the configuration.
2025-06-18 17:26:38 +02:00
Vadim Zeitlin
fe5ef47635 Merge branch 'circle-ci'
Add Circle CI build workflow: apparently it needs to exist on master and
so can't be tested from a branch.

See #1281.
2025-06-18 17:25:06 +02:00
Vadim Zeitlin
fc7162ea62 Add build workflow using Fedora to Circle CI
This will allow testing with newer gcc/clang version than what is
available in Ubuntu on GitHub Actions.
2025-06-18 17:13:57 +02:00
Vadim Zeitlin
21a0a29f0f Skip Cirrus CI build if only Circle CI configuration was changed 2025-06-18 17:13:37 +02:00
Vadim Zeitlin
836ff6b299 Remove Gitter notification hook from Circle CI workflow
This doesn't seem to work any longer and wasn't really useful.
2025-06-18 16:53:02 +02:00
Vadim Zeitlin
89dfd94ff2 Include <cstdint> to get uintptr_t definition
This somehow compiled before but doesn't do it any longer with gcc 15.
2025-06-18 16:14:08 +02:00
Vadim Zeitlin
1525a74520 Merge branch 'postgresql-old'
Improve support for old PostgreSQL versions.

See #1280.
2025-06-13 17:43:13 +02:00
Vadim Zeitlin
add463ba73 Don't put semicolon inside SOCI_UNUSED() macro
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.
2025-06-13 17:43:02 +02:00
Vadim Zeitlin
6dac7658d7 Implement tcp_user_timeout support with libpq < 12 under Linux
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.
2025-06-13 17:06:32 +02:00
Vadim Zeitlin
df64c26f0f Define SOCI_POSTGRESQL_NO_LO64 for PostgreSQL backend itself
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).
2025-06-13 16:17:22 +02:00
Vadim Zeitlin
71c189efe8 Merge branch 'restore-appveyor-msvs2015'
Restore MSVS 2015 and MSBuild CI builds on AppVeyor.

See #1278.
2025-06-13 01:33:25 +02:00
Vadim Zeitlin
ac3573ee81 Switch another AppVeyor build to "Debug" to speed it up
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.
2025-06-13 01:32:11 +02:00
Vadim Zeitlin
a2f8d61242 Get rid of SOCI_INT8_T_IS_CHAR too
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.
2025-06-13 01:31:08 +02:00
Vadim Zeitlin
424b3c22eb Fix remaining hardcoded types in type_conversion<>
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.
2025-06-13 01:31:08 +02:00
Vadim Zeitlin
8f8353f359 Switch AppVeyor CI MSVS 2015 build to "Debug" configuration
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.
2025-06-13 00:39:51 +02:00
Vadim Zeitlin
2890781e63 Simplify CMake configuration command used under AppVeyor
Make it more consistent with the command used in GitHub Actions MSW
workflow.
2025-06-13 00:36:45 +02:00
Vadim Zeitlin
4863346066 Show CMAKE_BUILD_TYPE in the final status after configuring
This can be useful to see in the CI jobs logs too.
2025-06-13 00:34:52 +02:00
Vadim Zeitlin
21ac203e32 Restore MSBuild testing on AppVeyor
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.
2025-06-12 22:12:52 +02:00
Vadim Zeitlin
ff8e45beb0 Add back MSVS 2015 AppVeyor CI build accidentally removed
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.
2025-06-12 22:09:50 +02:00
Vadim Zeitlin
3922d8bee9 Rearrange AppVeyor CI builds in failure probability order
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.
2025-06-12 22:08:30 +02:00
Vadim Zeitlin
185feedba0 Remove SOCI_INT64_T_IS_LONG and the test for it in CMake
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.
2025-06-12 22:01:44 +02:00
Vadim Zeitlin
ee4feb035e PostgreSQL: Make TCP timeout more consistent between platforms
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).
2025-06-12 18:45:23 +02:00
Vadim Zeitlin
d64067d329 Use smart pointer instead of manual PQfinish() calls
Clean up the code a little and ensure that PQfinish() is called by using
a smart pointer instead of having to manually call whenever returning
early.
2025-06-12 18:44:23 +02:00
Vadim Zeitlin
4f3f533d42 Merge branch 'pg-optimize'
Some minor PostgreSQL optimizations.

See #1276.
2025-06-12 18:19:12 +02:00
Vadim Zeitlin
e6bf2f1755 Merge branch 'pg-timeout'
Add support for TCP timeout in PostgreSQL backend under Windows too.

See #1275.
2025-06-12 18:13:48 +02:00
Vadim Zeitlin
cb258f3653 Add postgresql_session_backend::deallocate_all_prepared_statements()
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.
2025-06-12 16:47:17 +02:00
Vadim Zeitlin
9a3846dcd3 Add possibility to skip deallocating prepared statements
This can take a surprisingly long time, so let programs that terminate
quickly skip doing this, as it will be done anyhow when session is
closed.
2025-06-12 16:47:17 +02:00
Vadim Zeitlin
89f213abdb Stop setting "extra_float_digits" for PostgreSQL >= 12
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.
2025-06-12 16:47:17 +02:00
Vadim Zeitlin
0798333a8e Change "tracefile" to overwrite by default, use "+" to append
It seems more convenient, even if a bit dangerous, to make overwrite the
default mode.
2025-06-12 16:47:15 +02:00
Vadim Zeitlin
3f8d4c9398 Add "tracefile" connection parameter to PostgreSQL backend
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.
2025-06-12 16:46:46 +02:00
Vadim Zeitlin
a7a343805c PostgreSQL: Implement support for TCP user timeout under Windows
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.
2025-06-12 16:35:10 +02:00
Vadim Zeitlin
4d29d9799c Show time taken for the query to fail in "Reconnect" unit test
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.
2025-06-12 02:02:53 +02:00
Vadim Zeitlin
71118b6f0a Show time taken for the query to fail in "Reconnect" unit test
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.
2025-06-11 20:47:55 +02:00
Vadim Zeitlin
1914a92865 Remove unused Git attributes
It doesn't make much sense to define attributes for files with
extensions that are not present at all in this repository.
2025-06-10 17:25:38 +02:00
Vadim Zeitlin
fec74dc08b Firebird: Classify UNIQUE constraint violation correctly
It makes sense to recognize UNIQUE violation as a constraint violation
as well.
2025-06-10 02:15:46 +02:00
Vadim Zeitlin
ffa5d70b87 Output SOCI version and build type information at the end
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.
2025-06-09 14:58:49 +02:00