Skip to content

Commit

Permalink
Connection pool
Browse files Browse the repository at this point in the history
Added any_connection and any_address
Added connection_pool and pooled_connection
Added thread_safety tests
Added defaults.hpp header

close 19
  • Loading branch information
anarthal committed Dec 20, 2023
1 parent 45e6a3b commit bc5577e
Show file tree
Hide file tree
Showing 137 changed files with 13,765 additions and 458 deletions.
3 changes: 3 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Diagnostics:
ClangTidy:
Remove: bugprone-unused-return-value
12 changes: 6 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#

_triggers = { "branch": [ "master", "develop", "drone*", "feature/*", "bugfix/*", "fix/*", "pr/*" ] }
_container_tag = '454e58d36a2e801a1a6b4e9fd2f995c3087740b1'
_win_container_tag = '454e58d36a2e801a1a6b4e9fd2f995c3087740b1'
_container_tag = 'd34a92a9b9702a0a5e2b9ab4a635f7b077229626'
_win_container_tag = 'd34a92a9b9702a0a5e2b9ab4a635f7b077229626'


def _image(name):
Expand All @@ -24,7 +24,7 @@ def _b2_command(
variant,
stdlib='native',
address_model='64',
server_host='localhost',
server_host='127.0.0.1',
separate_compilation=1,
address_sanitizer=0,
undefined_sanitizer=0
Expand Down Expand Up @@ -56,7 +56,7 @@ def _cmake_command(
install_tests=1,
generator='Ninja',
db='mysql8',
server_host='localhost'
server_host='127.0.0.1'
):
return 'python tools/ci.py ' + \
'--build-kind=cmake ' + \
Expand Down Expand Up @@ -175,7 +175,7 @@ def windows_b2(
cxxstd=cxxstd,
variant=variant,
address_model=address_model,
server_host='localhost'
server_host='127.0.0.1'
)
return _pipeline(name=name, image=image, os='windows', command=command, db=None)

Expand Down Expand Up @@ -218,7 +218,7 @@ def windows_cmake(
build_shared_libs=build_shared_libs,
generator='Visual Studio 17 2022',
db='mysql8',
server_host='localhost'
server_host='127.0.0.1'
)
return _pipeline(
name=name,
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
unlink /usr/local/bin/python
unlink /usr/local/bin/python || echo "/usr/local/bin/python not found"
ln -s /usr/local/bin/python3 /usr/local/bin/python
python -m pip install requests
source tools/setup_db_osx.sh
python tools/ci.py \
--build-kind=b2 \
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ add_library(Boost::mysql ALIAS boost_mysql)
# Dependencies
if (BOOST_MYSQL_IS_ROOT)
# If we're the root project, error if a dependency is not found
find_package(Boost ${BOOST_MYSQL_VERSION} REQUIRED COMPONENTS headers system)
find_package(Boost ${BOOST_MYSQL_VERSION} REQUIRED COMPONENTS headers)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
target_link_libraries(
boost_mysql
INTERFACE
Boost::headers
Boost::system
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
Expand Down Expand Up @@ -64,12 +63,14 @@ else()
Boost::config
Boost::core
Boost::describe
Boost::endian
Boost::intrusive
Boost::lexical_cast
Boost::mp11
Boost::optional
Boost::system
Boost::throw_exception
Boost::variant2
Boost::endian
Boost::lexical_cast
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
Expand Down Expand Up @@ -117,4 +118,8 @@ if(BUILD_TESTING)
add_subdirectory(example)
endif()

# We don't run benchmarks, but we build them to prevent code rotting
if (BOOST_MYSQL_IS_ROOT)
add_subdirectory(bench)
endif()
endif()
18 changes: 18 additions & 0 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright (c) 2019-2023 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#


add_executable(
boost_mysql_bench_connection_pool
connection_pool.cpp
)

target_link_libraries(
boost_mysql_bench_connection_pool
PUBLIC
boost_mysql_compiled
)
Loading

0 comments on commit bc5577e

Please sign in to comment.