diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 6c940f9..1ed962e 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(demo main.cpp - object.cpp) +add_executable(demo main.cpp) + target_link_libraries(demo PRIVATE matador-core matador-orm diff --git a/demo/main.cpp b/demo/main.cpp index ae9bfed..dad6b7d 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -1,9 +1,9 @@ -#include "matador/query/column.hpp" #include "matador/sql/connection.hpp" #include "matador/sql/query_macro.hpp" #include "matador/query/criteria.hpp" #include "matador/query/query.hpp" +#include "matador/query/table_column.hpp" #include "matador/object/object_ptr.hpp" #include "matador/object/repository.hpp" @@ -11,12 +11,8 @@ #include "matador/utils/access.hpp" #include "matador/utils/default_type_traits.hpp" #include "matador/utils/enum_mapper.hpp" -#include "matador/utils/types.hpp" - -#include "matador/sql/query_macro.hpp" #include -#include struct author { unsigned int id{}; @@ -144,20 +140,20 @@ struct matador::utils::data_type_traits { } }; -// QUERY_HELPER( authors, AUTHOR, id, first_name, last_name, date_of_birth, year_of_birth, distinguished ) -// -// QUERY_HELPER( books, BOOK, id, author_id, title, published_in ) -// -// QUERY_HELPER( job, JOB, id, payload, type, description, state, mode ) -// -// QUERY_HELPER( payload, PAYLOAD, id ) -// -// QUERY_HELPER( temporary_table, TEMPORARY_TABLE, id ); -// -// QUERY_HELPER(customer, CUSTOMER, id, name, email, address) -// QUERY_HELPER(product, PRODUCT, id, title, description, price, category) -// QUERY_HELPER(category, CATEGORY, id, title, description) -// QUERY_HELPER(cart, CART, id, items, owner) +QUERY_HELPER(authors, AUTHOR, id, first_name, last_name, date_of_birth, year_of_birth, distinguished) + +QUERY_HELPER(books, BOOK, id, author_id, title, published_in) + +QUERY_HELPER(job, JOB, id, payload, type, description, state, mode) + +QUERY_HELPER(payload, PAYLOAD, id ) + +QUERY_HELPER(temporary_table, TEMPORARY_TABLE, id ); + +QUERY_HELPER(customer, CUSTOMER, id, name, email, address) +QUERY_HELPER(product, PRODUCT, id, title, description, price, category) +QUERY_HELPER(category, CATEGORY, id, title, description) +QUERY_HELPER(cart, CART, id, items, owner) int main() { using namespace matador::sql; diff --git a/include/matador/sql/query_macro.hpp b/include/matador/sql/query_macro.hpp index 0b0e93d..8396dc2 100644 --- a/include/matador/sql/query_macro.hpp +++ b/include/matador/sql/query_macro.hpp @@ -9,7 +9,7 @@ #include #include -#define FIELD(x) const matador::query::column& x = create_column(*this, #x); +#define FIELD(x) const matador::query::table_column x = create_column(*this, #x); #define QUERY_HELPER(C, V, ...) \ namespace matador::query::meta { \