observer progress, added to schema and added schema_observer class
This commit is contained in:
@@ -3,11 +3,14 @@
|
||||
|
||||
#include "matador/sql/backend_provider.hpp"
|
||||
#include "matador/sql/connection.hpp"
|
||||
#include "matador/sql/connection_pool.hpp"
|
||||
#include "matador/sql/interface/connection_impl.hpp"
|
||||
|
||||
#include "matador/query/criteria_evaluator.hpp"
|
||||
#include "matador/query/query.hpp"
|
||||
#include "matador/query/column.hpp"
|
||||
#include "matador/query/table.hpp"
|
||||
#include "matador/query/schema.hpp"
|
||||
|
||||
#include "matador/orm/session_query_builder.hpp"
|
||||
|
||||
@@ -34,7 +37,9 @@ TEST_CASE("Create sql query data for entity with eager has one", "[query][entity
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<airplane>("airplanes")
|
||||
.and_then( [&scm] { return scm.attach<flight>("flights"); } );
|
||||
REQUIRE(result);
|
||||
@@ -82,7 +87,9 @@ TEST_CASE("Create sql query data for entity with eager belongs to", "[query][ent
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<author>("authors")
|
||||
.and_then( [&scm] { return scm.attach<book>("books"); } );
|
||||
REQUIRE(result);
|
||||
@@ -145,7 +152,9 @@ TEST_CASE("Create sql query data for entity with eager has many belongs to", "[q
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<product>("products")
|
||||
.and_then( [&scm] { return scm.attach<order_details>("order_details"); } )
|
||||
.and_then( [&scm] { return scm.attach<supplier>("suppliers"); } )
|
||||
@@ -206,10 +215,12 @@ TEST_CASE("Create sql query data for entity with eager many to many", "[query][e
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<recipe>("recipes")
|
||||
.and_then( [&scm] { return scm.attach<ingredient>("ingredients"); } );
|
||||
// .and_then( [&scm] { return scm.attach<recipe_ingredient>("recipe_ingredients"); } );
|
||||
REQUIRE(result);
|
||||
|
||||
session_query_builder eqb(scm, db);
|
||||
|
||||
@@ -254,10 +265,12 @@ TEST_CASE("Create sql query data for entity with eager many to many (inverse par
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<student>("students")
|
||||
.and_then( [&scm] { return scm.attach<course>("courses"); } );
|
||||
// .and_then( [&scm] { return scm.attach<student_course>("student_courses"); } );
|
||||
REQUIRE(result);
|
||||
|
||||
session_query_builder eqb(scm, db);
|
||||
|
||||
@@ -302,9 +315,12 @@ TEST_CASE("Test eager relationship", "[session][eager]") {
|
||||
using namespace matador::test;
|
||||
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());
|
||||
connection db("noop://noop.db");
|
||||
repository scm("noop");
|
||||
connection_pool pool("noop://noop.db", 4);
|
||||
|
||||
schema scm(pool);
|
||||
auto result = scm.attach<department>("departments")
|
||||
.and_then( [&scm] { return scm.attach<employee>("employees"); } );
|
||||
REQUIRE(result);
|
||||
|
||||
session_query_builder eqb(scm, db);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user