insert_query_builder progress
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "SessionFixture.hpp"
|
||||
|
||||
#include "connection.hpp"
|
||||
|
||||
#include "models/airplane.hpp"
|
||||
#include "models/author.hpp"
|
||||
#include "models/book.hpp"
|
||||
@@ -20,6 +22,7 @@ TEST_CASE_METHOD(SessionFixture, "Session insert test", "[session][insert]") {
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
auto plane = ses.insert(make_object<airplane>(1, "Boeing", "A380"));
|
||||
REQUIRE(plane.is_ok());
|
||||
|
||||
@@ -36,6 +39,7 @@ TEST_CASE_METHOD(SessionFixture, "Session update test", "[session][update]") {
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(res.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
auto result = ses.insert(make_object<airplane>(1, "Boeing", "A380"));
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
@@ -66,6 +70,8 @@ TEST_CASE_METHOD(SessionFixture, "Session delete test", "[session][delete]") {
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(res.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
schema.initialize(ses);
|
||||
|
||||
auto result = ses.insert(make_object<airplane>(1, "Boeing", "A380"));
|
||||
@@ -90,6 +96,7 @@ TEST_CASE_METHOD(SessionFixture, "Session relation test", "[session][relation]")
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
auto plane = ses.insert(make_object<airplane>(1, "Boeing", "A380"));
|
||||
REQUIRE(plane.is_ok());
|
||||
auto f = ses.insert(make_object<flight>(2, *plane, "sully"));
|
||||
@@ -111,6 +118,7 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find object with id", "[session
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
auto a380 = ses.insert(make_object<airplane>(1, "Boeing", "A380"));
|
||||
REQUIRE(a380.is_ok());
|
||||
|
||||
@@ -130,6 +138,8 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects", "[session][f
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
std::vector planes {
|
||||
make_object<airplane>(1, "Airbus", "A380"),
|
||||
make_object<airplane>(2, "Boeing", "707"),
|
||||
@@ -165,6 +175,7 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-ma
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
schema.initialize(ses);
|
||||
std::vector authors {
|
||||
make_object<author>(1, "Michael", "Crichton", "23.10.1942", 1975, true),
|
||||
@@ -219,6 +230,8 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-ma
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
std::vector departments {
|
||||
make_object<department>(1, "Insurance"),
|
||||
make_object<department>(2, "Invoice")
|
||||
@@ -276,6 +289,8 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with many-to-m
|
||||
return schema.create(db);
|
||||
} );
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
std::vector ingredients {
|
||||
make_object<ingredient>(1, "Apple"),
|
||||
make_object<ingredient>(2, "Strawberry"),
|
||||
@@ -310,6 +325,8 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with many-to-m
|
||||
return schema.create(db);
|
||||
} );
|
||||
|
||||
orm::session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
std::vector ingredients {
|
||||
make_object<ingredient>(1, "Apple"),
|
||||
make_object<ingredient>(2, "Strawberry"),
|
||||
|
||||
Reference in New Issue
Block a user