|
|
|
@@ -16,13 +16,19 @@ class table;
|
|
|
|
|
class table_column {
|
|
|
|
|
public:
|
|
|
|
|
table_column(const char *name); // NOLINT(*-explicit-constructor)
|
|
|
|
|
table_column(std::string name); // NOLINT(*-explicit-constructor)
|
|
|
|
|
table_column(std::string name, std::string alias);
|
|
|
|
|
table_column(sql::sql_function_t func, std::string name);
|
|
|
|
|
table_column(const class table* tab, std::string name);
|
|
|
|
|
table_column(const class table* tab, std::string name, std::string alias);
|
|
|
|
|
table_column(const class table* tab, std::string name, utils::basic_type type, const utils::field_attributes& attributes);
|
|
|
|
|
table_column(const class table*, std::string name, std::string alias, utils::basic_type type, const utils::field_attributes& attributes, sql::sql_function_t func = sql::sql_function_t::None);
|
|
|
|
|
table_column(const std::string& name); // NOLINT(*-explicit-constructor)
|
|
|
|
|
table_column(const std::string& name, const std::string& alias);
|
|
|
|
|
table_column(sql::sql_function_t func, const std::string& name);
|
|
|
|
|
table_column(const class table* tab, const std::string& name);
|
|
|
|
|
table_column(const class table* tab, const std::string& name,
|
|
|
|
|
const std::string& alias);
|
|
|
|
|
table_column(const class table* tab, const std::string& name, utils::basic_type type, const utils::field_attributes& attributes);
|
|
|
|
|
table_column(const class table*,
|
|
|
|
|
const std::string& name,
|
|
|
|
|
const std::string& alias,
|
|
|
|
|
utils::basic_type type,
|
|
|
|
|
const utils::field_attributes& attributes,
|
|
|
|
|
sql::sql_function_t func = sql::sql_function_t::None);
|
|
|
|
|
table_column& operator=(const table_column& other);
|
|
|
|
|
table_column(const table_column& other) = default;
|
|
|
|
|
table_column(table_column&& other) noexcept = default;
|
|
|
|
@@ -30,10 +36,11 @@ public:
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] bool equals(const table_column &x) const;
|
|
|
|
|
|
|
|
|
|
table_column as(const std::string& alias) const;
|
|
|
|
|
[[nodiscard]] table_column as(const std::string& alias) const;
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] const std::string& name() const;
|
|
|
|
|
[[nodiscard]] std::string canonical_name() const;
|
|
|
|
|
[[nodiscard]] const std::string& column_name() const;
|
|
|
|
|
[[nodiscard]] const std::string& canonical_name() const;
|
|
|
|
|
[[nodiscard]] const std::string& alias() const;
|
|
|
|
|
[[nodiscard]] utils::basic_type type() const;
|
|
|
|
|
[[nodiscard]] utils::field_attributes attributes() const;
|
|
|
|
@@ -49,11 +56,15 @@ public:
|
|
|
|
|
// ReSharper disable once CppNonExplicitConversionOperator
|
|
|
|
|
operator const std::string&() const; // NOLINT(*-explicit-constructor)
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static std::string build_column_name(const class table *tab, const std::string& name);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class table;
|
|
|
|
|
|
|
|
|
|
const class table* table_{nullptr};
|
|
|
|
|
std::string name_;
|
|
|
|
|
std::string column_name_;
|
|
|
|
|
std::string alias_;
|
|
|
|
|
utils::basic_type type_{utils::basic_type::Unknown};
|
|
|
|
|
utils::field_attributes attributes_{};
|
|
|
|
|