changed the interface of on_primary_key to have a third parameter of type primary_key_attribute

This commit is contained in:
Sascha Kühl
2025-07-18 12:08:21 +02:00
parent d8e43c1f95
commit 7b5123df16
38 changed files with 274 additions and 392 deletions
-8
View File
@@ -18,14 +18,6 @@ column_generator::column_generator(std::vector<column> &column_infos,
seen_tables.insert(table_name);
}
void column_generator::on_primary_key(const char *id, std::string &, size_t)
{
if (has_many_to_many_) {
return;
}
push(id);
}
void column_generator::on_revision(const char *id, unsigned long long int &)
{
if (has_many_to_many_) {
@@ -4,25 +4,11 @@
namespace matador::sql {
namespace detail {
void fk_result_binder::on_primary_key(const char * /*id*/, std::string &value, const size_t size)
{
utils::data_type_traits<std::string>::read_value(*binder_, id_, index_++, value, size);
}
}
void object_result_binder::reset()
{
index_ = 0;
}
void object_result_binder::on_primary_key(const char *id, std::string &value, const size_t size)
{
utils::data_type_traits<std::string>::read_value(*binder_, id, index_++, value, size);
}
void object_result_binder::on_revision(const char *id, uint64_t &value)
{
utils::data_type_traits<uint64_t>::read_value(*binder_, id, index_++, value);
@@ -3,15 +3,6 @@
#include "matador/utils/value.hpp"
namespace matador::sql::internal {
void query_result_pk_resolver::on_primary_key(const char* id, std::string& /*value*/, const size_t size) {
if (!type_stack_.empty()) {
return;
}
std::string value;
utils::data_type_traits<std::string>::read_value(reader_, id, column_index_++, value, size);
pk_ = value;
}
void query_result_pk_resolver::on_attribute(const char *id, const utils::value &x, const utils::field_attributes &attr) {
if (is_constraint_set(attr.options(), utils::constraints::PRIMARY_KEY)) {
if (x.is_integer()) {
@@ -3,25 +3,11 @@
namespace matador::sql {
namespace detail {
void fk_binder::on_primary_key(const char * /*id*/, std::string &value, size_t /*size*/)
{
utils::data_type_traits<std::string>::bind_value(*binder_, index_++, value);
}
}
void object_parameter_binder::reset(const size_t start_index)
{
index_ = start_index;
}
void object_parameter_binder::on_primary_key(const char * /*id*/, std::string &val, const size_t size)
{
utils::data_type_traits<std::string>::bind_value(*binder_, index_++, val, size);
}
void object_parameter_binder::on_revision(const char * /*id*/, uint64_t &rev)
{
utils::data_type_traits<uint64_t>::bind_value(*binder_, index_++, rev);