added sqlite connection class (progress)
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user