added pk information to class object

This commit is contained in:
Sascha Kühl
2025-11-25 08:54:58 +01:00
parent ede5a8c636
commit ab7a2db869
6 changed files with 52 additions and 17 deletions
+9
View File
@@ -6,6 +6,8 @@
#include "matador/object/constraint.hpp"
#include "matador/object/constraints_generator.hpp"
#include "matador/utils/identifier.hpp"
namespace matador::object {
class repository;
@@ -27,6 +29,10 @@ public:
void add_attribute(attribute attr);
void add_constraint(class constraint c);
[[nodiscard]] const attribute* primary_key_attribute() const;
[[nodiscard]] const utils::identifier& primary_key() const;
[[nodiscard]] bool has_primary_key() const;
[[nodiscard]] const std::string& name() const;
[[nodiscard]] const std::string& alias() const;
@@ -40,10 +46,13 @@ public:
private:
friend class constraints_generator;
friend class attribute_generator;
std::string name_;
std::string alias_;
attribute* pk_attribute_{nullptr};
utils::identifier pk_identifier_;
std::vector<attribute> attributes_;
std::vector<class constraint> constraints_;
};