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
@@ -35,7 +35,7 @@ public:
utils::result<std::unique_ptr<sql::statement_impl>, utils::error> prepare(const sql::query_context &context) override;
utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> fetch(const sql::query_context &context) override;
utils::result<std::vector<object::attribute_definition>, utils::error> describe(const std::string& table) override;
utils::result<std::vector<object::attribute>, utils::error> describe(const std::string& table) override;
utils::result<bool, utils::error> exists(const std::string &schema_name, const std::string &table_name) override;
[[nodiscard]] std::string to_escaped_string( const utils::blob& value ) const override;
@@ -3,7 +3,7 @@
#include "postgres_result_reader.hpp"
#include "postgres_statement.hpp"
#include "matador/object/attribute_definition.hpp"
#include "matador/object/attribute.hpp"
#include "matador/sql/error_code.hpp"
#include "matador/sql/record.hpp"
@@ -89,7 +89,7 @@ utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> postgres_co
return utils::failure(make_error(sql::error_code::FETCH_FAILED, res, conn_, "Failed to fetch", context.sql));
}
std::vector<object::attribute_definition> prototype = context.prototype;
std::vector<object::attribute> prototype = context.prototype;
const int num_col = PQnfields(res);
if (prototype.size() != static_cast<size_t>(num_col)) {
@@ -212,7 +212,7 @@ utils::basic_type string2type(const char *type) {
}
}
utils::result<std::vector<object::attribute_definition>, utils::error> postgres_connection::describe(const std::string &table) {
utils::result<std::vector<object::attribute>, utils::error> postgres_connection::describe(const std::string &table) {
const std::string stmt(
"SELECT ordinal_position, column_name, udt_name, data_type, is_nullable, column_default FROM information_schema.columns WHERE table_schema='public' AND table_name='"
+ table + "'");
@@ -224,7 +224,7 @@ utils::result<std::vector<object::attribute_definition>, utils::error> postgres_
}
postgres_result_reader reader(res);
std::vector<object::attribute_definition> prototype;
std::vector<object::attribute> prototype;
while (auto fetched = reader.fetch()) {
if (!fetched.is_ok()) {
return utils::failure(fetched.release_error());