added meta table macro and removed unused query_macro

This commit is contained in:
2025-12-31 13:54:32 +01:00
parent e768497cfd
commit 7cb64515bd
8 changed files with 40 additions and 73 deletions
-33
View File
@@ -35,39 +35,6 @@ using namespace matador::utils;
using namespace matador::sql;
using namespace matador::test;
// #define FIELD(FIELD_NAME) const matador::query::column& FIELD_NAME = create_column(*this, #FIELD_NAME);
//
// #define META_TABLE(TABLE_NAME, VARIABLE_NAME, ...) \
// namespace matador::query::meta { \
// namespace internal { \
// class TABLE_NAME##_table : public table { \
// public: \
// TABLE_NAME##_table() : table(#TABLE_NAME) {} \
// MAP(FIELD, __VA_ARGS__) \
// }; } \
// static const internal:: TABLE_NAME##_table VARIABLE_NAME; \
// }
//
// META_TABLE( books, BOOK, id, author_id, title, published_in )
class book_table : public table {
public:
book_table()
: table("books", {"id", "title", "author_id"})
, id(*column_by_name(*this, "id"))
, title(*column_by_name(*this, "id"))
, author_id(*column_by_name(*this, "author_id")) {
}
const table_column& id;
const table_column& title;
const table_column& author_id;
};
book_table BOOK;
using namespace matador::test;
TEST_CASE("Create sql query data for entity with eager has one", "[query][entity][builder]") {
using namespace matador::test;
backend_provider::instance().register_backend("noop", std::make_unique<orm::test_backend_service>());