Skip to content

Commit 2e25903

Browse files
committed
VER: Release C++ client 0.55.0
1 parent b79e143 commit 2e25903

9 files changed

Lines changed: 43 additions & 29 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Checks: >
33
-*,
44
bugprone-*,
55
-bugprone-easily-swappable-parameters,
6+
-bugprone-invalid-enum-default-initialization,
67
clang-analyzer-*,
78
-clang-analyzer-optin.cplusplus.VirtualCall,
89
clang-diagnostic-*,

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.55.0 - TBD
3+
## 0.55.0 - 2026-04-28
44

55
### Enhancements
66
- Improved `DbnDecoder` throughput on current-version data and `AsIs` workloads by
@@ -9,6 +9,8 @@
99
- Made `detail::Buffer` shifts explicit to avoid redundant moves during record decoding
1010
- Added new publisher values for Cboe Titanium Cboe Global Indices Feed
1111
- Added `Year` to `SplitDuration` enum for yearly historical batch job submissions
12+
- Upgraded default cpp-httplib version to 0.43.1
13+
- Upgraded default nlohmann/json version to 3.12.0
1214

1315
## 0.54.0 - 2026-04-21
1416

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24..4.2)
66

77
project(
88
databento
9-
VERSION 0.54.0
9+
VERSION 0.55.0
1010
LANGUAGES CXX
1111
DESCRIPTION "Official Databento client library"
1212
)
@@ -152,7 +152,7 @@ if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_JSON)
152152
find_package(nlohmann_json REQUIRED)
153153
endif()
154154
else()
155-
set(json_version 3.11.3)
155+
set(json_version 3.12.0)
156156
# Required to correctly install nlohmann_json
157157
set(JSON_Install ON)
158158
FetchContent_Declare(
@@ -178,7 +178,7 @@ if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_HTTPLIB)
178178
find_package(httplib REQUIRED)
179179
endif()
180180
else()
181-
set(httplib_version 0.37.2)
181+
set(httplib_version 0.43.1)
182182
FetchContent_Declare(
183183
httplib
184184
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${httplib_version}.tar.gz

include/databento/detail/http_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class HttpClient {
4343
httplib::Result&& res) const;
4444
void CheckWarnings(const httplib::Response& response) const;
4545

46-
static const httplib::Headers kHeaders;
46+
static const httplib::Headers& BaseHeaders();
4747

4848
ILogReceiver* log_receiver_;
4949
httplib::Client client_;

include/databento/symbology.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <ostream>
44
#include <string>
5+
#include <string_view>
56
#include <unordered_map>
67
#include <vector>
78

@@ -28,10 +29,10 @@ struct SymbologyResolution {
2829
//
2930
// Throws InvalidArgumentError if symbols is empty or the iterator range is
3031
// empty.
31-
std::string JoinSymbolStrings(const std::string& method_name,
32+
std::string JoinSymbolStrings(std::string_view method_name,
3233
std::vector<std::string>::const_iterator symbols_begin,
3334
std::vector<std::string>::const_iterator symbols_end);
34-
std::string JoinSymbolStrings(const std::string& method_name,
35+
std::string JoinSymbolStrings(std::string_view method_name,
3536
const std::vector<std::string>& symbols);
3637
std::string ToString(const SymbologyResolution& sym_res);
3738
std::ostream& operator<<(std::ostream& stream, const SymbologyResolution& sym_res);

pkg/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Databento <support@databento.com>
22
_pkgname=databento-cpp
33
pkgname=databento-cpp-git
4-
pkgver=0.54.0
4+
pkgver=0.55.0
55
pkgrel=1
66
pkgdesc="Official C++ client for Databento"
77
arch=('any')

src/detail/http_client.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@
1515
using databento::detail::HttpClient;
1616

1717
constexpr std::chrono::seconds kTimeout{100};
18-
const httplib::Headers HttpClient::kHeaders{
19-
{"accept", "application/json"},
20-
{"user-agent", kUserAgent},
21-
};
18+
19+
const httplib::Headers& HttpClient::BaseHeaders() {
20+
static const httplib::Headers kHeaders{
21+
{"accept", "application/json"},
22+
{"user-agent", kUserAgent},
23+
};
24+
return kHeaders;
25+
}
2226

2327
HttpClient::HttpClient(databento::ILogReceiver* log_receiver, const std::string& key,
2428
const std::string& gateway)
2529
: log_receiver_{log_receiver}, client_{gateway} {
26-
auto headers = HttpClient::kHeaders;
30+
auto headers = HttpClient::BaseHeaders();
2731
headers.insert(httplib::make_basic_authentication_header(key, ""));
2832
client_.set_default_headers(headers);
2933
client_.set_basic_auth(key, "");
@@ -34,7 +38,7 @@ HttpClient::HttpClient(databento::ILogReceiver* log_receiver, const std::string&
3438
HttpClient::HttpClient(databento::ILogReceiver* log_receiver, const std::string& key,
3539
const std::string& gateway, std::uint16_t port)
3640
: log_receiver_{log_receiver}, client_{gateway, port} {
37-
auto headers = HttpClient::kHeaders;
41+
auto headers = HttpClient::BaseHeaders();
3842
headers.insert(httplib::make_basic_authentication_header(key, ""));
3943
client_.set_default_headers(headers);
4044
client_.set_basic_auth(key, "");

src/historical.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <iterator> // back_inserter
1414
#include <optional>
1515
#include <sstream>
16+
#include <string_view>
1617
#include <system_error>
1718
#include <utility> // move
1819
#include <variant>
@@ -226,7 +227,7 @@ Historical::Historical(ILogReceiver* log_receiver, std::string key, std::string
226227
upgrade_policy_{upgrade_policy},
227228
client_{log_receiver, key_, gateway_, port} {}
228229

229-
static const std::string kBatchSubmitJobEndpoint = "Historical::BatchSubmitJob";
230+
constexpr std::string_view kBatchSubmitJobEndpoint = "Historical::BatchSubmitJob";
230231

231232
databento::BatchJob Historical::BatchSubmitJob(
232233
const std::string& dataset, const std::vector<std::string>& symbols, Schema schema,
@@ -471,7 +472,7 @@ void Historical::DownloadFile(const std::string& url,
471472
} catch (const databento::Exception& exc) {
472473
retry += 1;
473474
if (retry == kMaxRetries) {
474-
throw exc;
475+
throw;
475476
}
476477
ss.str("");
477478
ss << '[' << kMethod << "] Retrying download attempt " << retry + 1 << " after "
@@ -685,7 +686,7 @@ databento::DatasetRange Historical::MetadataGetDatasetRange(
685686
std::move(range_by_schema)};
686687
}
687688

688-
static const std::string kMetadataGetRecordCountEndpoint =
689+
constexpr std::string_view kMetadataGetRecordCountEndpoint =
689690
"Historical::MetadataGetRecordCount";
690691

691692
std::uint64_t Historical::MetadataGetRecordCount(
@@ -738,7 +739,7 @@ std::uint64_t Historical::MetadataGetRecordCount(const httplib::Params& params)
738739
return json;
739740
}
740741

741-
static const std::string kMetadataGetBillableSizeEndpoint =
742+
constexpr std::string_view kMetadataGetBillableSizeEndpoint =
742743
"Historical::MetadataGetBillableSize";
743744

744745
std::uint64_t Historical::MetadataGetBillableSize(
@@ -792,7 +793,7 @@ std::uint64_t Historical::MetadataGetBillableSize(const httplib::Params& params)
792793
return json;
793794
}
794795

795-
static const std::string kMetadataGetCostEndpoint = "Historical::MetadataGetCost";
796+
constexpr std::string_view kMetadataGetCostEndpoint = "Historical::MetadataGetCost";
796797

797798
double Historical::MetadataGetCost(const std::string& dataset,
798799
const DateTimeRange<UnixNanos>& datetime_range,
@@ -912,8 +913,13 @@ databento::SymbologyResolution Historical::SymbologyResolve(
912913
return res;
913914
}
914915

915-
static const std::string kTimeseriesGetRangeEndpoint = "Historical::TimeseriesGetRange";
916-
static const std::string kTimeseriesGetRangePath = ::BuildTimeseriesPath(".get_range");
916+
constexpr std::string_view kTimeseriesGetRangeEndpoint =
917+
"Historical::TimeseriesGetRange";
918+
919+
static const std::string& TimeseriesGetRangePath() {
920+
static const std::string kPath = ::BuildTimeseriesPath(".get_range");
921+
return kPath;
922+
}
917923

918924
void Historical::TimeseriesGetRange(const std::string& dataset,
919925
const DateTimeRange<UnixNanos>& datetime_range,
@@ -986,7 +992,7 @@ void Historical::TimeseriesGetRange(const HttplibParams& params,
986992

987993
bool early_exit = false;
988994
this->client_.PostRawStream(
989-
kTimeseriesGetRangePath, params,
995+
TimeseriesGetRangePath(), params,
990996
[&decoder, &early_exit](const char* data, std::size_t length) mutable {
991997
if (decoder.Process(data, length) == KeepGoing::Continue) {
992998
return true;
@@ -1050,11 +1056,11 @@ databento::DbnStore Historical::TimeseriesGetRange(
10501056
return this->TimeseriesGetRange(params);
10511057
}
10521058
databento::DbnStore Historical::TimeseriesGetRange(const HttplibParams& params) {
1053-
auto stream = client_.OpenPostStream(kTimeseriesGetRangePath, params);
1059+
auto stream = client_.OpenPostStream(TimeseriesGetRangePath(), params);
10541060
return DbnStore{log_receiver_, std::move(stream), upgrade_policy_};
10551061
}
10561062

1057-
static const std::string kTimeseriesGetRangeToFileEndpoint =
1063+
constexpr std::string_view kTimeseriesGetRangeToFileEndpoint =
10581064
"Historical::TimeseriesGetRangeToFile";
10591065

10601066
databento::DbnStore Historical::TimeseriesGetRangeToFile(
@@ -1111,7 +1117,7 @@ databento::DbnStore Historical::TimeseriesGetRangeToFile(
11111117
const HttplibParams& params, const std::filesystem::path& file_path) {
11121118
{
11131119
OutFileStream out_file{file_path};
1114-
this->client_.PostRawStream(kTimeseriesGetRangePath, params,
1120+
this->client_.PostRawStream(TimeseriesGetRangePath(), params,
11151121
[&out_file](const char* data, std::size_t length) {
11161122
out_file.WriteAll(
11171123
reinterpret_cast<const std::byte*>(data), length);

src/symbology.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ TsSymbolMap SymbologyResolution::CreateSymbolMap() const {
3333
return res;
3434
}
3535

36-
std::string JoinSymbolStrings(const std::string& method_name,
36+
std::string JoinSymbolStrings(std::string_view method_name,
3737
std::vector<std::string>::const_iterator symbols_begin,
3838
std::vector<std::string>::const_iterator symbols_end) {
3939
if (symbols_begin == symbols_end) {
40-
throw InvalidArgumentError{method_name, "symbols", "Cannot be empty"};
40+
throw InvalidArgumentError{std::string{method_name}, "symbols", "Cannot be empty"};
4141
}
4242
return std::accumulate(symbols_begin, symbols_end, std::string{},
4343
[](std::string acc, const std::string& sym) {
4444
return acc.empty() ? sym : std::move(acc) + ',' + sym;
4545
});
4646
}
4747

48-
std::string JoinSymbolStrings(const std::string& method_name,
48+
std::string JoinSymbolStrings(std::string_view method_name,
4949
const std::vector<std::string>& symbols) {
5050
if (symbols.empty()) {
51-
throw InvalidArgumentError{method_name, "symbols", "Cannot be empty"};
51+
throw InvalidArgumentError{std::string{method_name}, "symbols", "Cannot be empty"};
5252
}
5353
return JoinSymbolStrings(method_name, symbols.begin(), symbols.end());
5454
}

0 commit comments

Comments
 (0)