26 lines
658 B
C++
26 lines
658 B
C++
#ifndef QUERY_QUERY_HELPER_HPP
|
|
#define QUERY_QUERY_HELPER_HPP
|
|
|
|
#include "matador/utils/macro_map.hpp"
|
|
|
|
#include "matador/query/table.hpp"
|
|
#include "matador/query/table_column.hpp"
|
|
|
|
#include <string>
|
|
#include <ostream>
|
|
|
|
#define FIELD(x) const matador::query::table_column x = create_column(*this, #x);
|
|
|
|
#define QUERY_HELPER(C, V, ...) \
|
|
namespace matador::query::meta { \
|
|
namespace internal { \
|
|
class C##_table : public table { \
|
|
public: \
|
|
C##_table() : table(#C) {} \
|
|
MAP(FIELD, __VA_ARGS__) \
|
|
}; } \
|
|
static const internal:: C##_table V; \
|
|
}
|
|
|
|
#endif //QUERY_QUERY_HELPER_HPP
|