renamed schema to repository
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "catch2/matchers/catch_matchers_string.hpp"
|
||||
|
||||
#include "matador/object/attribute_definition.hpp"
|
||||
#include "matador/object/schema.hpp"
|
||||
#include "matador/object/repository.hpp"
|
||||
|
||||
#include "matador/sql/connection.hpp"
|
||||
#include "matador/sql/column_generator.hpp"
|
||||
@@ -25,9 +25,9 @@ using namespace matador::object;
|
||||
using namespace matador::query;
|
||||
|
||||
TEST_CASE_METHOD( QueryFixture, "Insert and select basic datatypes", "[query][datatypes]" ) {
|
||||
REQUIRE(schema.attach<types>("types"));
|
||||
REQUIRE(repo.attach<types>("types"));
|
||||
auto res = query::create()
|
||||
.table<types>("types", schema)
|
||||
.table<types>("types", repo)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 0);
|
||||
@@ -74,13 +74,13 @@ TEST_CASE_METHOD( QueryFixture, "Insert and select basic datatypes", "[query][da
|
||||
};
|
||||
|
||||
res = query::insert()
|
||||
.into("types", column_generator::generate<types>(schema, true))
|
||||
.into("types", column_generator::generate<types>(repo, true))
|
||||
.values(t)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 1);
|
||||
|
||||
auto result = query::select<types>(schema)
|
||||
auto result = query::select<types>(repo)
|
||||
.from("types")
|
||||
.fetch_one<types>(db);
|
||||
REQUIRE(result.is_ok());
|
||||
@@ -278,9 +278,9 @@ TEST_CASE_METHOD(QueryFixture, "Test quoted literals", "[query][quotes][literals
|
||||
TEST_CASE_METHOD(QueryFixture, "Test describe table", "[query][describe][table]") {
|
||||
using namespace matador::sql;
|
||||
|
||||
REQUIRE(schema.attach<types>("types"));
|
||||
REQUIRE(repo.attach<types>("types"));
|
||||
const auto res = query::create()
|
||||
.table<types>("types", schema)
|
||||
.table<types>("types", repo)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 0);
|
||||
@@ -351,9 +351,9 @@ TEST_CASE_METHOD(QueryFixture, "Test primary key", "[query][primary key]") {
|
||||
using namespace matador::test::temporary;
|
||||
using namespace matador::sql;
|
||||
|
||||
REQUIRE(schema.attach<pk>("pk"));
|
||||
REQUIRE(repo.attach<pk>("pk"));
|
||||
auto res = query::create()
|
||||
.table<pk>("pk", schema)
|
||||
.table<pk>("pk", repo)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 0);
|
||||
@@ -362,13 +362,13 @@ TEST_CASE_METHOD(QueryFixture, "Test primary key", "[query][primary key]") {
|
||||
pk pk1{ 7, "george" };
|
||||
|
||||
res = query::insert()
|
||||
.into("pk", column_generator::generate<pk>(schema))
|
||||
.into("pk", column_generator::generate<pk>(repo))
|
||||
.values(pk1)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 1);
|
||||
|
||||
auto row = query::select<pk>(schema)
|
||||
auto row = query::select<pk>(repo)
|
||||
.from("pk")
|
||||
.fetch_one<pk>(db);
|
||||
REQUIRE(row.is_ok());
|
||||
@@ -380,9 +380,9 @@ TEST_CASE_METHOD(QueryFixture, "Test primary key prepared", "[query][primary key
|
||||
using namespace matador::test::temporary;
|
||||
using namespace matador::sql;
|
||||
|
||||
REQUIRE(schema.attach<pk>("pk"));
|
||||
REQUIRE(repo.attach<pk>("pk"));
|
||||
auto res = query::create()
|
||||
.table<pk>("pk", schema)
|
||||
.table<pk>("pk", repo)
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 0);
|
||||
@@ -391,7 +391,7 @@ TEST_CASE_METHOD(QueryFixture, "Test primary key prepared", "[query][primary key
|
||||
pk pk1{ 7, "george" };
|
||||
|
||||
auto stmt = query::insert()
|
||||
.into("pk", column_generator::generate<pk>(schema))
|
||||
.into("pk", column_generator::generate<pk>(repo))
|
||||
.values<pk>()
|
||||
.prepare(db);
|
||||
REQUIRE(stmt);
|
||||
@@ -401,7 +401,7 @@ REQUIRE(stmt);
|
||||
REQUIRE(res.is_ok());
|
||||
REQUIRE(*res == 1);
|
||||
|
||||
stmt = query::select<pk>(schema)
|
||||
stmt = query::select<pk>(repo)
|
||||
.from("pk")
|
||||
.prepare(db);
|
||||
REQUIRE(stmt);
|
||||
|
||||
Reference in New Issue
Block a user