added sqlite db backend progress
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
|
||||
namespace matador::backends::sqlite {
|
||||
|
||||
sqlite_connection::sqlite_connection(sql::connection_info info)
|
||||
: connection_impl(std::move(info)) {
|
||||
|
||||
sqlite_connection::sqlite_connection(const sql::connection_info &info)
|
||||
: connection_impl(info) {
|
||||
}
|
||||
|
||||
void sqlite_connection::open()
|
||||
@@ -30,7 +29,7 @@ void sqlite_connection::close()
|
||||
|
||||
bool sqlite_connection::is_open()
|
||||
{
|
||||
return false;
|
||||
return sqlite_db_ != nullptr;
|
||||
}
|
||||
|
||||
void sqlite_connection::execute(const std::string &stmt)
|
||||
@@ -43,4 +42,18 @@ void sqlite_connection::prepare(const std::string &stmt)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
MATADOR_SQLITE_API matador::sql::connection_impl *create_database(const matador::sql::connection_info &info)
|
||||
{
|
||||
return new matador::backends::sqlite::sqlite_connection(info);
|
||||
}
|
||||
|
||||
MATADOR_SQLITE_API void destroy_database(matador::sql::connection_impl *db)
|
||||
{
|
||||
delete db;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[[maybe_unused]] const matador::sql::dialect* get_dialect() {
|
||||
using namespace matador::sql;
|
||||
static dialect d {{
|
||||
const static dialect d{{
|
||||
{ dialect::token_t::BEGIN, "BEGIN TRANSACTION"},
|
||||
{ dialect::token_t::COMMIT, "COMMIT TRANSACTION"},
|
||||
{ dialect::token_t::ROLLBACK, "ROLLBACK TRANSACTION"}
|
||||
|
||||
Reference in New Issue
Block a user