fixed backend test compilation
This commit is contained in:
@@ -14,8 +14,8 @@ struct author;
|
||||
|
||||
struct book {
|
||||
unsigned int id{};
|
||||
matador::object::object_ptr<author> book_author;
|
||||
std::string title;
|
||||
object::object_ptr<author> book_author;
|
||||
unsigned short published_in{};
|
||||
|
||||
template<typename Operator>
|
||||
|
||||
@@ -21,7 +21,7 @@ struct flight
|
||||
: id(id), airplane(plane), pilot_name(std::move(name)) {}
|
||||
|
||||
unsigned int id{};
|
||||
object::object_ptr<test::airplane> airplane;
|
||||
object::object_ptr<airplane> airplane;
|
||||
std::string pilot_name;
|
||||
|
||||
template<class Operator>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef QUERY_PERSON_HPP
|
||||
#define QUERY_PERSON_HPP
|
||||
|
||||
#include "matador/utils/access.hpp"
|
||||
#include "matador/utils/field_attributes.hpp"
|
||||
#include "matador/utils/types.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace matador::test {
|
||||
|
||||
struct person {
|
||||
unsigned int id{};
|
||||
std::string name;
|
||||
unsigned int age{};
|
||||
utils::blob image;
|
||||
|
||||
template<class Operator>
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "name", name, 255);
|
||||
field::attribute(op, "age", age);
|
||||
field::attribute(op, "image", image);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
#endif //QUERY_PERSON_HPP
|
||||
@@ -11,15 +11,13 @@ struct types
|
||||
enum { CSTR_LEN=255 };
|
||||
|
||||
unsigned int id_ = 0;
|
||||
char char_ = 'c';
|
||||
int8_t char_ = 'c';
|
||||
short short_ = -127;
|
||||
int int_ = -65000;
|
||||
long long_ = -128000;
|
||||
long long long64_ = -1234567890;
|
||||
unsigned char unsigned_char_ = 'H';
|
||||
unsigned short unsigned_short_ = 128;
|
||||
unsigned int unsigned_int_ = 65000;
|
||||
unsigned long unsigned_long_ = 128000;
|
||||
unsigned long long unsigned_long64_ = 1234567890;
|
||||
float float_ = 3.1415f;
|
||||
double double_ = 1.1414;
|
||||
@@ -42,19 +40,17 @@ struct types
|
||||
field::attribute(op, "val_double", double_);
|
||||
field::attribute(op, "val_short", short_);
|
||||
field::attribute(op, "val_int", int_);
|
||||
field::attribute(op, "val_long", long_);
|
||||
field::attribute(op, "val_long_long", long64_);
|
||||
field::attribute(op, "val_unsigned_char", unsigned_char_);
|
||||
field::attribute(op, "val_unsigned_short", unsigned_short_);
|
||||
field::attribute(op, "val_unsigned_int", unsigned_int_);
|
||||
field::attribute(op, "val_unsigned_long", unsigned_long_);
|
||||
field::attribute(op, "val_unsigned_long_long", unsigned_long64_);
|
||||
field::attribute(op, "val_bool", bool_);
|
||||
field::attribute(op, "val_cstr", cstr_, CSTR_LEN);
|
||||
field::attribute(op, "val_string", string_);
|
||||
field::attribute(op, "val_varchar", varchar_, 63);
|
||||
field::attribute(op, "val_date", date_);
|
||||
field::attribute(op, "val_time", time_);
|
||||
// field::attribute(op, "val_date", date_);
|
||||
// field::attribute(op, "val_time", time_);
|
||||
field::attribute(op, "val_binary", binary_);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user