orm schema class progress added SchemaTest.cpp
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "matador/sql/backend_provider.hpp"
|
||||
#include "matador/sql/connection.hpp"
|
||||
#include "matador/sql/column.hpp"
|
||||
#include "matador/sql/table.hpp"
|
||||
|
||||
#include "matador/query/query.hpp"
|
||||
|
||||
#include "matador/orm/session_insert_builder.hpp"
|
||||
|
||||
#include "../backend/test_connection.hpp"
|
||||
#include "../backend/test_backend_service.hpp"
|
||||
|
||||
#include "../../models/airplane.hpp"
|
||||
#include "../../models/author.hpp"
|
||||
#include "../../models/department.hpp"
|
||||
#include "../../models/book.hpp"
|
||||
#include "../../models/flight.hpp"
|
||||
#include "../../models/recipe.hpp"
|
||||
#include "../../models/order.hpp"
|
||||
#include "../../models/student.hpp"
|
||||
|
||||
using namespace matador::object;
|
||||
using namespace matador::orm;
|
||||
using namespace matador::query;
|
||||
using namespace matador::sql;
|
||||
using namespace matador::test;
|
||||
|
||||
TEST_CASE("Create sql insert for entity with eager has one", "[query][entity][insert][builder]") {
|
||||
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");
|
||||
auto result = scm.attach<airplane>("airplanes")
|
||||
.and_then( [&scm] { return scm.attach<flight>("flights"); } );
|
||||
REQUIRE(result);
|
||||
|
||||
session_insert_builder eib(scm);
|
||||
|
||||
auto b737 = object_ptr(new airplane{0, "Boeing", "737"});
|
||||
flight f1{0, b737, "F828"};
|
||||
|
||||
// auto data = eib.build(f1);
|
||||
|
||||
// REQUIRE(data.is_ok());
|
||||
}
|
||||
Reference in New Issue
Block a user