added mysql backend

This commit is contained in:
2023-12-17 22:11:43 +01:00
parent 2893f749b6
commit 320d06bb20
39 changed files with 1272 additions and 46 deletions
@@ -35,7 +35,7 @@ public:
sql::record describe(const std::string& table) override;
bool exists(const std::string &table_name) override;
bool exists(const std::string &schema_name, const std::string &table_name) override;
private:
struct fetch_context
+1 -2
View File
@@ -156,7 +156,6 @@ sql::record sqlite_connection::describe(const std::string& table)
auto index = strtoul(reader.column(0), &end, 10);
std::string name = reader.column(1);
// Todo: extract size
auto type = (string2type(reader.column(2)));
end = nullptr;
utils::constraints options{};
@@ -170,7 +169,7 @@ sql::record sqlite_connection::describe(const std::string& table)
return std::move(prototype);
}
bool sqlite_connection::exists(const std::string &table_name)
bool sqlite_connection::exists(const std::string &schema_name, const std::string &table_name)
{
const auto result = fetch_internal("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND tbl_name='" + table_name + "' LIMIT 1");
sqlite_result_reader reader(result.rows, result.prototype.size());