added sqlite connection class (progress)

This commit is contained in:
2023-11-07 23:07:49 +01:00
parent f4f5c00eec
commit 715f4dff8f
21 changed files with 645 additions and 73 deletions
@@ -0,0 +1,26 @@
#ifndef QUERY_SQLITE_CONNECTION_HPP
#define QUERY_SQLITE_CONNECTION_HPP
#include "matador/sql/connection_impl.hpp"
#include <sqlite3.h>
namespace matador::backends::sqlite {
class sqlite_connection : public matador::sql::connection_impl
{
public:
explicit sqlite_connection(sql::connection_info info);
void open() override;
void close() override;
bool is_open() override;
void execute(const std::string &stmt) override;
void prepare(const std::string &stmt) override;
private:
sqlite3 *sqlite_db_{};
};
}
#endif //QUERY_SQLITE_CONNECTION_HPP
+15
View File
@@ -0,0 +1,15 @@
#ifndef QUERY_SQLITE_ERROR_HPP
#define QUERY_SQLITE_ERROR_HPP
#include <string>
struct sqlite3;
namespace matador::backends::sqlite {
void throw_sqlite_error(int ec, sqlite3 *db, const std::string &source);
void throw_sqlite_error(int ec, sqlite3 *db, const std::string &source, const std::string &sql);
}
#endif //QUERY_SQLITE_ERROR_HPP