small fixes for table, column and query_macro
This commit is contained in:
@@ -34,6 +34,8 @@ public:
|
||||
[[nodiscard]] std::shared_ptr<table> table() const;
|
||||
void table(const std::shared_ptr<query::table>& t);
|
||||
|
||||
operator const std::string&() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<query::table> table_;
|
||||
std::string name;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "matador/query/fk_value_extractor.hpp"
|
||||
#include "matador/query/internal/column_value_pair.hpp"
|
||||
|
||||
#include "matador/utils/foreign_attributes.hpp"
|
||||
#include "matador/utils/primary_key_attribute.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -15,8 +15,7 @@ public:
|
||||
table() = default;
|
||||
table(const char *name); // NOLINT(*-explicit-constructor)
|
||||
table(std::string name); // NOLINT(*-explicit-constructor)
|
||||
table(const char *name, std::string as); // NOLINT(*-explicit-constructor)
|
||||
table(std::string name, std::string as); // NOLINT(*-explicit-constructor)
|
||||
table(std::string name, std::string as);
|
||||
table(std::string name, std::string as, const std::vector<column> &columns);
|
||||
|
||||
table& as(const std::string &a);
|
||||
@@ -31,7 +30,9 @@ public:
|
||||
[[nodiscard]] const std::string& alias() const;
|
||||
[[nodiscard]] const std::vector<column>& columns() const;
|
||||
|
||||
operator const std::vector<column>&() const;
|
||||
[[nodiscard]] column column(const std::string &name) const;
|
||||
|
||||
operator const std::vector<query::column>&() const;
|
||||
private:
|
||||
friend class column;
|
||||
|
||||
@@ -39,7 +40,7 @@ private:
|
||||
std::string alias_;
|
||||
|
||||
std::string schema_name_;
|
||||
std::vector<column> columns_;
|
||||
std::vector<query::column> columns_;
|
||||
};
|
||||
|
||||
table operator ""_tab(const char *name, size_t len);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
|
||||
#define FIELD(x) const column x{*this, #x, ""};
|
||||
#define FIELD(x) const matador::query::column x{*this, #x, ""};
|
||||
|
||||
#define QUERY_HELPER(C, V, ...) \
|
||||
namespace matador::query::meta { \
|
||||
|
||||
Reference in New Issue
Block a user