Commit 8fd24ddc authored by msobczak's avatar msobczak

Added get backend name.

parent 67fa9ca4
......@@ -165,6 +165,8 @@ struct empty_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "empty"; }
void clean_up();
virtual empty_statement_backend * make_statement_backend();
......
......@@ -297,6 +297,8 @@ struct firebird_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "firebird"; }
void cleanUp();
virtual firebird_statement_backend * make_statement_backend();
......
......@@ -39,9 +39,9 @@ class mysql_soci_error : public soci_error
{
public:
mysql_soci_error(std::string const & msg, int errNum)
: soci_error(msg), errNum_(errNum) {}
: soci_error(msg), err_num_(errNum) {}
unsigned int errNum_;
unsigned int err_num_;
};
struct mysql_statement_backend;
......@@ -231,6 +231,8 @@ struct mysql_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "mysql"; }
void clean_up();
virtual mysql_statement_backend * make_statement_backend();
......
......@@ -230,6 +230,8 @@ struct odbc_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "odbc"; }
void reset_transaction();
void clean_up();
......
......@@ -40,7 +40,7 @@ class SOCI_ORACLE_DECL oracle_soci_error : public soci_error
public:
oracle_soci_error(std::string const & msg, int errNum = 0);
int errNum_;
int err_num_;
};
......@@ -251,6 +251,8 @@ struct oracle_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "oracle"; }
void clean_up();
virtual oracle_statement_backend * make_statement_backend();
......
......@@ -224,6 +224,8 @@ struct postgresql_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "postgresql"; }
void clean_up();
virtual postgresql_statement_backend * make_statement_backend();
......
......@@ -383,6 +383,17 @@ void test7()
std::cout << "test 7 passed" << std::endl;
}
void test8()
{
{
session sql(backEnd, connectString);
assert(sql.get_backend_name() == "postgresql");
}
std::cout << "test 8 passed" << std::endl;
}
// DDL Creation objects for common tests
struct table_creator_one : public table_creator_base
{
......@@ -493,6 +504,7 @@ int main(int argc, char** argv)
std::cout << "test 6 skipped (dynamic backend)\n";
test7();
test8();
std::cout << "\nOK, all tests passed.\n\n";
return EXIT_SUCCESS;
......
......@@ -235,6 +235,8 @@ struct sqlite3_session_backend : details::session_backend
virtual void commit();
virtual void rollback();
virtual std::string get_backend_name() const { return "sqlite3"; }
void clean_up();
virtual sqlite3_statement_backend * make_statement_backend();
......
......@@ -350,6 +350,11 @@ bool session::get_uppercase_column_names() const
}
}
std::string session::get_backend_name() const
{
return backEnd_->get_backend_name();
}
statement_backend * session::make_statement_backend()
{
ensureConnected(backEnd_);
......
......@@ -80,6 +80,8 @@ public:
// (downcast it to expected back-end session class)
details::session_backend * get_backend() { return backEnd_; }
std::string get_backend_name() const;
details::statement_backend * make_statement_backend();
details::rowid_backend * make_rowid_backend();
details::blob_backend * make_blob_backend();
......
......@@ -175,6 +175,8 @@ public:
virtual void commit() = 0;
virtual void rollback() = 0;
virtual std::string get_backend_name() const = 0;
virtual statement_backend * make_statement_backend() = 0;
virtual rowid_backend * make_rowid_backend() = 0;
virtual blob_backend * make_blob_backend() = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment