added sql function and alias
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
|
||||
namespace matador::sql {
|
||||
|
||||
class column;
|
||||
|
||||
class dialect
|
||||
{
|
||||
public:
|
||||
@@ -61,6 +63,7 @@ public:
|
||||
|
||||
using token_to_string_map = std::unordered_map<token_t, std::string>;
|
||||
using data_type_to_string_map = std::unordered_map<data_type_t, std::string>;
|
||||
using sql_func_to_string_map = std::unordered_map<sql_function_t, std::string>;
|
||||
|
||||
public:
|
||||
dialect() = default;
|
||||
@@ -79,7 +82,7 @@ public:
|
||||
* @param str The identifier string to be prepared
|
||||
* @return The prepared string
|
||||
*/
|
||||
std::string prepare_identifier(const std::string &str) const;
|
||||
std::string prepare_identifier(const column &col) const;
|
||||
|
||||
/**
|
||||
* Prepare string literal
|
||||
@@ -196,6 +199,15 @@ private:
|
||||
{data_type_t::type_null, "NULL"},
|
||||
{data_type_t::type_unknown, "UNKNOWN"}
|
||||
};
|
||||
|
||||
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" },
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user