compilation fixes

This commit is contained in:
Sascha Kühl
2025-11-19 16:17:25 +01:00
parent 9c42df3f83
commit 95c555d03a
20 changed files with 118 additions and 80 deletions
+62 -5
View File
@@ -1,11 +1,72 @@
#ifndef MATADOR_BUILDER_HPP
#define MATADOR_BUILDER_HPP
#include "matador/object/attribute_definition.hpp"
#include "matador/query/column.hpp"
#include "matador/query/table.hpp"
#include "matador/utils/basic_types.hpp"
#include <string>
namespace matador::object {
class entity {
public:
explicit entity(std::string name)
: name_(std::move(name)) {}
[[nodiscard]] const std::string& name() const;
private:
std::string name_;
std::string alias_;
};
class attribute {
public:
attribute(std::string name, const utils::basic_type type)
: name_(std::move(name))
, type_(type) {}
[[nodiscard]] const std::string& name() const;
[[nodiscard]] utils::basic_type type() const;
[[nodiscard]] const attribute_options& options() const;
private:
friend class entity;
std::string name_;
std::string alias_;
utils::basic_type type_{};
attribute_options options_;
entity* owner_{nullptr};
};
class constraint {
public:
explicit constraint(std::string name)
: name_(std::move(name)) {}
[[nodiscard]] const std::string& name() const;
[[nodiscard]] const std::string& column_name() const;
[[nodiscard]] const utils::constraints& type() const;
[[nodiscard]] bool is_primary_key_constraint() const;
[[nodiscard]] bool is_foreign_key_constraint() const;
[[nodiscard]] bool is_unique_constraint() const;
[[nodiscard]] const std::string& referenced_table() const;
[[nodiscard]] const std::string& referenced_column() const;
private:
std::string name_;
std::string column_name_;
utils::constraints type_{};
std::string referenced_table_;
std::string referenced_column_;
};
}
namespace matador::query {
class column_builder {
@@ -19,10 +80,6 @@ private:
std::string column_name;
};
struct constraint {
std::string name;
};
class table_builder {
public:
explicit table_builder(std::string name);
@@ -45,7 +102,7 @@ public:
constraint_builder& references(std::string table, std::string column);
// ReSharper disable once CppNonExplicitConversionOperator
operator query::constraint() const; // NOLINT(*-explicit-constructor)
operator object::constraint() const; // NOLINT(*-explicit-constructor)
private:
std::string constraint_name;
+2
View File
@@ -8,6 +8,8 @@
#include "matador/utils/placeholder.hpp"
#include <optional>
namespace matador::sql {
class connection_impl;
class dialect;