renamed class attribute_definition to attribute

This commit is contained in:
Sascha Kühl
2025-11-21 09:22:00 +01:00
parent dae3c1645b
commit 758284c2b3
44 changed files with 490 additions and 491 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef QUERY_CONNECTION_HPP
#define QUERY_CONNECTION_HPP
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include "matador/sql/abstract_sql_logger.hpp"
#include "matador/sql/connection_info.hpp"
@@ -126,7 +126,7 @@ public:
*/
[[nodiscard]] utils::result<void, utils::error> rollback() const;
[[nodiscard]] utils::result<std::vector<object::attribute_definition>, utils::error> describe(const std::string &table_name) const;
[[nodiscard]] utils::result<std::vector<object::attribute>, utils::error> describe(const std::string &table_name) const;
[[nodiscard]] utils::result<bool, utils::error> exists(const std::string &schema_name, const std::string &table_name) const;
[[nodiscard]] utils::result<bool, utils::error> exists(const std::string &table_name) const;
@@ -3,7 +3,7 @@
#include <memory>
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include "matador/sql/connection_info.hpp"
#include "matador/sql/query_context.hpp"
@@ -38,7 +38,7 @@ public:
virtual utils::result<std::unique_ptr<query_result_impl>, utils::error> fetch(const query_context &context) = 0;
virtual utils::result<std::unique_ptr<statement_impl>, utils::error> prepare(const query_context &context) = 0;
virtual utils::result<std::vector<object::attribute_definition>, utils::error> describe(const std::string &table) = 0;
virtual utils::result<std::vector<object::attribute>, utils::error> describe(const std::string &table) = 0;
virtual utils::result<bool, utils::error> exists(const std::string &schema_name, const std::string &table_name) = 0;
[[nodiscard]] const class dialect &dialect() const;
@@ -12,7 +12,7 @@
#include "matador/sql/internal/query_result_pk_resolver.hpp"
#include "matador/sql/record.hpp"
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include <iostream>
#include <memory>
@@ -73,9 +73,9 @@ private:
class query_result_impl {
public:
query_result_impl(std::unique_ptr<query_result_reader> &&reader,
std::vector<object::attribute_definition> &&prototype, size_t column_index = 0);
std::vector<object::attribute> &&prototype, size_t column_index = 0);
query_result_impl(std::unique_ptr<query_result_reader> &&reader,
const std::vector<object::attribute_definition> &prototype, size_t column_index = 0);
const std::vector<object::attribute> &prototype, size_t column_index = 0);
template<typename ValueType>
void on_primary_key(const char *id, ValueType &value, const utils::primary_key_attribute& attr = utils::default_pk_attributes) {
@@ -183,7 +183,7 @@ public:
return true;
}
[[nodiscard]] const std::vector<object::attribute_definition> &prototype() const;
[[nodiscard]] const std::vector<object::attribute> &prototype() const;
private:
template<class Type>
@@ -209,7 +209,7 @@ private:
protected:
size_t column_index_ = 0;
std::vector<object::attribute_definition> prototype_;
std::vector<object::attribute> prototype_;
std::unique_ptr<query_result_reader> reader_;
detail::pk_reader pk_reader_;
std::stack<std::type_index> type_stack_;
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef QUERY_QUERY_DATA_HPP
#define QUERY_QUERY_DATA_HPP
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include "matador/query/table.hpp"
#include "matador/utils/types.hpp"
@@ -36,7 +36,7 @@ struct query_context {
std::string command_name{};
std::string schema_name{};
std::string table_name{};
std::vector<object::attribute_definition> prototype{};
std::vector<object::attribute> prototype{};
std::vector<std::string> result_vars{};
std::vector<std::string> bind_vars{};
std::vector<utils::database_type> bind_types{};
+2 -2
View File
@@ -9,12 +9,12 @@
#include <string>
#include <ostream>
#define FIELD(x) const sql::column x{*this, #x, ""};
#define FIELD(x) const query::column x{*this, #x, ""};
#define QUERY_HELPER(C, ...) \
namespace matador::qh { \
namespace internal { \
struct C##_query : sql::table { \
struct C##_query : query::table { \
C##_query() : table(#C) {} \
MAP(FIELD, __VA_ARGS__) \
}; } \
+3 -3
View File
@@ -1,7 +1,7 @@
#ifndef QUERY_QUERY_RESULT_HPP
#define QUERY_QUERY_RESULT_HPP
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include "matador/sql/internal/query_result_impl.hpp"
@@ -102,12 +102,12 @@ private:
namespace detail {
template < typename Type >
Type* create_prototype(const std::vector<object::attribute_definition> &/*prototype*/) {
Type* create_prototype(const std::vector<object::attribute> &/*prototype*/) {
return new Type{};
}
template <>
record* create_prototype<record>(const std::vector<object::attribute_definition> &prototype);
record* create_prototype<record>(const std::vector<object::attribute> &prototype);
}