added sqlite connection class (progress)

This commit is contained in:
2023-11-09 19:48:29 +01:00
parent 715f4dff8f
commit 8b5859d858
13 changed files with 227 additions and 25 deletions
+9 -4
View File
@@ -10,7 +10,7 @@
namespace matador::sql {
class [[nodiscard]] dialect
class dialect
{
public:
enum class token_t : uint8_t
@@ -59,7 +59,15 @@ public:
ESCAPE_CLOSING_BRACKET /**< The escape quotes differ; escape the closing one */
};
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>;
public:
dialect() = default;
dialect(const token_to_string_map &token_replace_map, const data_type_to_string_map &data_type_replace_map);
explicit dialect(const data_type_to_string_map &data_type_replace_map);
explicit dialect(const token_to_string_map &token_replace_map);
const std::string& token_at(token_t token) const;
const std::string& data_type_at(data_type_t type) const;
@@ -124,8 +132,6 @@ public:
const std::vector<std::string>& columns() const;
private:
using token_to_string_map = std::unordered_map<token_t, std::string>;
std::vector<std::string> host_vars_;
std::vector<std::string> columns_;
@@ -167,7 +173,6 @@ private:
{token_t::NONE, ""}
};
using data_type_to_string_map = std::unordered_map<data_type_t, std::string>;
data_type_to_string_map data_types_ {
{data_type_t::type_char, "TINYINT"},
{data_type_t::type_short, "SMALLINT"},