added session context and implemented the executor interface for session
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
namespace matador::test {
|
||||
|
||||
SessionFixture::SessionFixture()
|
||||
: pool(connection::dns, 4), ses(pool) {}
|
||||
: pool(connection::dns, 4), ses({bus, pool}) {}
|
||||
|
||||
SessionFixture::~SessionFixture() {
|
||||
while (!tables_to_drop.empty()) {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "matador/orm/session.hpp"
|
||||
|
||||
#include "matador/utils/message_bus.hpp"
|
||||
|
||||
#include "connection.hpp"
|
||||
|
||||
#include <stack>
|
||||
@@ -18,6 +20,7 @@ protected:
|
||||
sql::connection_pool pool;
|
||||
std::stack <std::string> tables_to_drop;
|
||||
orm::session ses;
|
||||
utils::message_bus bus;
|
||||
|
||||
private:
|
||||
void drop_table_if_exists(const std::string &table_name) const;
|
||||
|
||||
@@ -234,7 +234,4 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with many-to-m
|
||||
recipes.push_back(std::make_unique<recipe>(7, "Apple Crumble"));
|
||||
recipes.push_back(std::make_unique<recipe>(8, "Beans Chili"));
|
||||
recipes.push_back(std::make_unique<recipe>(9, "Fruit Salad"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -15,13 +15,13 @@ class StatementCacheFixture
|
||||
{
|
||||
public:
|
||||
StatementCacheFixture()
|
||||
: pool(test::connection::dns, 4), ses(pool)
|
||||
: pool(test::connection::dns, 4)//, ses(pool)
|
||||
{}
|
||||
~StatementCacheFixture() = default;
|
||||
|
||||
protected:
|
||||
sql::connection_pool pool;
|
||||
orm::session ses;
|
||||
// orm::session ses;
|
||||
};
|
||||
|
||||
TEST_CASE_METHOD(StatementCacheFixture, "Acquire prepared statement", "[statement cache]") {
|
||||
|
||||
Reference in New Issue
Block a user