fixed linux build for relation completer
This commit is contained in:
+2
-2
@@ -17,7 +17,7 @@ struct ingredient
|
||||
{
|
||||
unsigned int id{};
|
||||
std::string name;
|
||||
matador::object::collection<matador::object::object_ptr<recipe>> recipes{};
|
||||
matador::object::collection<matador::object::object_ptr<demo::recipe>> recipes{};
|
||||
|
||||
ingredient()= default;
|
||||
ingredient(const unsigned int id, std::string name)
|
||||
@@ -36,7 +36,7 @@ struct recipe
|
||||
{
|
||||
unsigned int id{};
|
||||
std::string name;
|
||||
matador::object::collection<matador::object::object_ptr<ingredient>> ingredients{};
|
||||
matador::object::collection<matador::object::object_ptr<demo::ingredient>> ingredients{};
|
||||
|
||||
recipe()= default;
|
||||
recipe(const unsigned int id, std::string name)
|
||||
|
||||
+4
-4
@@ -74,7 +74,7 @@ struct profile {
|
||||
unsigned int id{};
|
||||
std::string first_name;
|
||||
std::string last_name;
|
||||
matador::object::object_ptr<user> user;
|
||||
matador::object::object_ptr<demo::user> user;
|
||||
|
||||
template<typename Operator>
|
||||
void process(Operator &op) {
|
||||
@@ -88,7 +88,7 @@ struct profile {
|
||||
struct user {
|
||||
unsigned int id{};
|
||||
std::string username;
|
||||
matador::object::object_ptr<profile> profile;
|
||||
matador::object::object_ptr<demo::profile> profile;
|
||||
|
||||
template<typename Operator>
|
||||
void process(Operator &op) {
|
||||
@@ -137,7 +137,7 @@ int main() {
|
||||
// has_many_to_many (with join columns first)
|
||||
object::schema schema;
|
||||
|
||||
auto result = schema.attach<ingredient>("ingredients")
|
||||
auto result = schema.attach<demo::ingredient>("ingredients")
|
||||
.and_then([&schema] { return schema.attach<recipe>("recipes"); });
|
||||
|
||||
schema.dump(std::cout);
|
||||
@@ -146,7 +146,7 @@ int main() {
|
||||
// has_many_to_many (with join columns last)
|
||||
object::schema schema;
|
||||
|
||||
auto result = schema.attach<recipe>("recipes")
|
||||
auto result = schema.attach<demo::recipe>("recipes")
|
||||
.and_then([&schema] { return schema.attach<ingredient>("ingredients"); });
|
||||
|
||||
schema.dump(std::cout);
|
||||
|
||||
+4
-4
@@ -25,20 +25,20 @@
|
||||
|
||||
template <> struct matador::utils::data_type_traits<work::core::timestamp, void> {
|
||||
static basic_type type(std::size_t /*size*/) { return basic_type::type_uint64; }
|
||||
static void read_value(attribute_reader &reader, const char *id, size_t index, nullptr_t &/*value*/) {
|
||||
static void read_value(attribute_reader &/*reader*/, const char * /*id*/, size_t /*index*/, nullptr_t &/*value*/) {
|
||||
|
||||
}
|
||||
static void bind_value(attribute_writer &binder, size_t index, nullptr_t &/*value*/) {
|
||||
static void bind_value(attribute_writer &/*binder*/, size_t /*index*/, nullptr_t &/*value*/) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct matador::utils::data_type_traits<work::core::UserInfo, void> {
|
||||
static basic_type type(std::size_t /*size*/) { return basic_type::type_uint64; }
|
||||
static void read_value(attribute_reader &reader, const char *id, size_t index, nullptr_t &/*value*/) {
|
||||
static void read_value(attribute_reader &/*reader*/, const char * /*id*/, size_t /*index*/, nullptr_t &/*value*/) {
|
||||
|
||||
}
|
||||
static void bind_value(attribute_writer &binder, size_t index, nullptr_t &/*value*/) {
|
||||
static void bind_value(attribute_writer &/*binder*/, size_t /*index*/, nullptr_t &/*value*/) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
|
||||
#include "matador/utils/access.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace work::core {
|
||||
struct Model {
|
||||
unsigned long long id;
|
||||
unsigned long long version;
|
||||
uint64_t id;
|
||||
uint64_t version;
|
||||
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
namespace work::models::jobs {
|
||||
struct IdListPayload : Payload {
|
||||
matador::object::collection<unsigned long long> ids;
|
||||
matador::object::collection<uint64_t> payload_ids;
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
namespace field = matador::access;
|
||||
field::process( op, *matador::base_class<Payload>( this ) );
|
||||
field::has_many( op, "payload_ids", ids, "payload_id", matador::utils::default_foreign_attributes );
|
||||
field::has_many( op, "payload_ids", payload_ids, "payload_id", matador::utils::default_foreign_attributes );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
namespace work::models::jobs {
|
||||
struct IdPayload : Payload {
|
||||
unsigned long long id;
|
||||
uint64_t payload_id{};
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
namespace field = matador::access;
|
||||
field::process( op, *matador::base_class<Payload>( this ) );
|
||||
field::attribute( op, "id", id );
|
||||
field::attribute( op, "payload_id", payload_id );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ struct Task : core::Model {
|
||||
JobMode job_mode;
|
||||
core::timestamp start_delay;
|
||||
core::timestamp interval;
|
||||
unsigned long long user_session_id;
|
||||
uint64_t user_session_id;
|
||||
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
|
||||
Reference in New Issue
Block a user