some sql classes refactorings like column and table structs to classes
This commit is contained in:
@@ -54,6 +54,7 @@ public:
|
||||
[[nodiscard]] std::string prepare_identifier(const column &col) const;
|
||||
[[nodiscard]] std::string prepare_identifier_string(const std::string &col) const;
|
||||
[[nodiscard]] std::string prepare_condition(const column &col) const;
|
||||
[[nodiscard]] std::string table_name(const std::string &table, const std::string &schema_name) const;
|
||||
|
||||
[[nodiscard]] const std::string& to_string(bool val) const;
|
||||
|
||||
@@ -124,6 +125,56 @@ public:
|
||||
*/
|
||||
[[nodiscard]] std::string default_schema_name() const;
|
||||
|
||||
[[nodiscard]] const std::string& add_constraint() const;
|
||||
[[nodiscard]] const std::string& alter() const;
|
||||
[[nodiscard]] const std::string& and_() const;
|
||||
[[nodiscard]] const std::string& as() const;
|
||||
[[nodiscard]] const std::string& asc() const;
|
||||
[[nodiscard]] const std::string& begin() const;
|
||||
[[nodiscard]] const std::string& asterisk() const;
|
||||
[[nodiscard]] const std::string& begin_binary_data() const;
|
||||
[[nodiscard]] const std::string& begin_string_data() const;
|
||||
[[nodiscard]] const std::string& between() const;
|
||||
[[nodiscard]] const std::string& column() const;
|
||||
[[nodiscard]] const std::string& columns() const;
|
||||
[[nodiscard]] const std::string& commit() const;
|
||||
[[nodiscard]] const std::string& create() const;
|
||||
[[nodiscard]] const std::string& desc() const;
|
||||
[[nodiscard]] const std::string& distinct() const;
|
||||
[[nodiscard]] const std::string& drop() const;
|
||||
[[nodiscard]] const std::string& drop_constraint() const;
|
||||
[[nodiscard]] const std::string& end_binary_data() const;
|
||||
[[nodiscard]] const std::string& end_quote() const;
|
||||
[[nodiscard]] const std::string& end_string_data() const;
|
||||
[[nodiscard]] const std::string& foreign_key() const;
|
||||
[[nodiscard]] const std::string& from() const;
|
||||
[[nodiscard]] const std::string& group_by() const;
|
||||
[[nodiscard]] const std::string& in() const;
|
||||
[[nodiscard]] const std::string& insert() const;
|
||||
[[nodiscard]] const std::string& into() const;
|
||||
[[nodiscard]] const std::string& join() const;
|
||||
[[nodiscard]] const std::string& like() const;
|
||||
[[nodiscard]] const std::string& limit() const;
|
||||
[[nodiscard]] const std::string& not_() const;
|
||||
[[nodiscard]] const std::string& not_null() const;
|
||||
[[nodiscard]] const std::string& offset() const;
|
||||
[[nodiscard]] const std::string& on() const;
|
||||
[[nodiscard]] const std::string& or_() const;
|
||||
[[nodiscard]] const std::string& order_by() const;
|
||||
[[nodiscard]] const std::string& primary_key() const;
|
||||
[[nodiscard]] const std::string& references() const;
|
||||
[[nodiscard]] const std::string& remove() const;
|
||||
[[nodiscard]] const std::string& rollback() const;
|
||||
[[nodiscard]] const std::string& schema() const;
|
||||
[[nodiscard]] const std::string& select() const;
|
||||
[[nodiscard]] const std::string& set() const;
|
||||
[[nodiscard]] const std::string& start_quote() const;
|
||||
[[nodiscard]] const std::string& string_quote() const;
|
||||
[[nodiscard]] const std::string& table() const;
|
||||
[[nodiscard]] const std::string& update() const;
|
||||
[[nodiscard]] const std::string& values() const;
|
||||
[[nodiscard]] const std::string& where() const;
|
||||
|
||||
private:
|
||||
dialect() = default;
|
||||
|
||||
@@ -170,15 +221,16 @@ private:
|
||||
{dialect_token::Limit, "LIMIT"},
|
||||
{dialect_token::None, ""},
|
||||
{dialect_token::Not, "NOT"},
|
||||
{dialect_token::NotNull, "NOT NULL"},
|
||||
{dialect_token::NotNull, "NOT NULL"},
|
||||
{dialect_token::Offset, "OFFSET"},
|
||||
{dialect_token::On, "ON"},
|
||||
{dialect_token::Or, "OR"},
|
||||
{dialect_token::OrderBy, "ORDER BY"},
|
||||
{dialect_token::PrimaryKey, "PRIMARY KEY"},
|
||||
{dialect_token::References, "REFERENCES"},
|
||||
{dialect_token::PrimaryKey, "PRIMARY KEY"},
|
||||
{dialect_token::References, "REFERENCES"},
|
||||
{dialect_token::Remove, "DELETE"},
|
||||
{dialect_token::Rollback, "ROLLBACK TRANSACTION"},
|
||||
{dialect_token::Schema, "SCHEMA"},
|
||||
{dialect_token::Select, "SELECT"},
|
||||
{dialect_token::Set, "SET"},
|
||||
{dialect_token::StartQuote, "\""},
|
||||
@@ -210,12 +262,12 @@ private:
|
||||
};
|
||||
|
||||
sql_func_to_string_map sql_func_map_ {
|
||||
{sql_function_t::NONE, "NONE" },
|
||||
{sql_function_t::COUNT, "COUNT" },
|
||||
{sql_function_t::AVG, "AVG" },
|
||||
{sql_function_t::SUM, "SUM" },
|
||||
{sql_function_t::MIN, "MIN" },
|
||||
{sql_function_t::MAX, "MAX" },
|
||||
{sql_function_t::None, "NONE" },
|
||||
{sql_function_t::Count, "COUNT" },
|
||||
{sql_function_t::Avg, "AVG" },
|
||||
{sql_function_t::Sum, "SUM" },
|
||||
{sql_function_t::Min, "MIN" },
|
||||
{sql_function_t::Max, "MAX" },
|
||||
};
|
||||
|
||||
std::array<std::string, 2> bool_strings_ {
|
||||
|
||||
Reference in New Issue
Block a user