added where condition

This commit is contained in:
2023-11-02 20:15:13 +01:00
parent b9d9609c28
commit 487dfb2eb4
15 changed files with 1276 additions and 34 deletions
+29 -1
View File
@@ -6,10 +6,11 @@
#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
namespace matador::sql {
class dialect
class [[nodiscard]] dialect
{
public:
enum class token_t : uint8_t
@@ -52,6 +53,14 @@ public:
NONE
};
/**
* @brief Enum representing the compile type
*/
enum class compile_type_t : uint8_t {
PREPARED, /**< Compile type for prepared statements */
DIRECT /**< Compile type for direct execute statements */
};
/**
* Holding enums concerning escaping identifiers
*/
@@ -110,9 +119,28 @@ public:
*/
virtual escape_identifier_t identifier_escape_type() const;
/**
* Generates a next placeholder string. default is
* question mark '?'
*
* @return Placeholder string
*/
virtual std::string next_placeholder() const;
compile_type_t compile_type() const;
void add_host_var(const std::string &host_var);
void add_column(const std::string &column);
const std::vector<std::string>& host_vars() const;
const std::vector<std::string>& columns() const;
private:
using token_to_string_map = std::unordered_map<token_t, std::string>;
compile_type_t compile_type_ = compile_type_t::DIRECT;
std::vector<std::string> host_vars_;
std::vector<std::string> columns_;
token_to_string_map tokens_ {
{token_t::CREATE, "CREATE"},
{token_t::DROP, "DROP"},