renamed blob to blob_type_t

This commit is contained in:
2026-01-07 09:21:10 +01:00
parent 41f6c9f516
commit f30c250a20
44 changed files with 88 additions and 80 deletions
@@ -293,7 +293,7 @@ utils::result<bool, utils::error> postgres_connection::exists(const std::string
return utils::ok(*result == 1);
}
std::string postgres_connection::to_escaped_string(const utils::blob &value) const {
std::string postgres_connection::to_escaped_string(const utils::blob_type_t &value) const {
size_t escapedDataLength;
unsigned char *escapedData = PQescapeByteaConn(conn_, value.data(), value.size(), &escapedDataLength);
@@ -148,7 +148,7 @@ void postgres_parameter_binder::write_value(const size_t pos, const utils::time_
void postgres_parameter_binder::write_value(size_t pos, const utils::timestamp &x) {
}
void postgres_parameter_binder::write_value(const size_t pos, const utils::blob &x) {
void postgres_parameter_binder::write_value(const size_t pos, const utils::blob_type_t &x) {
bind_data_.bytes[pos] = x;
bind_data_.values[pos] = reinterpret_cast<char *>(bind_data_.bytes[pos].data());
bind_data_.lengths[pos] = static_cast<int>(bind_data_.bytes[pos].size());
@@ -145,7 +145,7 @@ void postgres_result_reader::read_value(const char * /*id*/, const size_t index,
value.assign(column(index));
}
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, utils::blob &value) {
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, utils::blob_type_t &value) {
const auto *data = reinterpret_cast<const unsigned char *>(column(index));
size_t length;
@@ -164,11 +164,11 @@ void set_value(const char *str, utils::value &value) {
}
template<>
void set_value<utils::blob>(const char *str, utils::value &value) {
void set_value<utils::blob_type_t>(const char *str, utils::value &value) {
size_t length;
unsigned char *unescaped = PQunescapeBytea(reinterpret_cast<const unsigned char *>(str), &length);
value = utils::blob(unescaped, unescaped + length);
value = utils::blob_type_t(unescaped, unescaped + length);
PQfreemem(unescaped);
}
@@ -232,7 +232,7 @@ void postgres_result_reader::read_value(const char * /*id*/, const size_t index,
break;
}
case utils::basic_type::Blob: {
set_value<utils::blob>(column(index), val);
set_value<utils::blob_type_t>(column(index), val);
break;
}
case utils::basic_type::Unknown: