74 lines
1.5 KiB
C++
74 lines
1.5 KiB
C++
#ifndef QUERY_CONNECTION_INTERMEDIATES_HPP
|
|
#define QUERY_CONNECTION_INTERMEDIATES_HPP
|
|
|
|
#include "matador/sql/result.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace matador::sql {
|
|
|
|
class basic_condition;
|
|
class connection;
|
|
class query_builder;
|
|
|
|
struct query_intermediate
|
|
{
|
|
query_intermediate(connection &db, query_builder &query);
|
|
|
|
connection &db;
|
|
query_builder &query;
|
|
};
|
|
|
|
struct query_finish : query_intermediate
|
|
{
|
|
using query_intermediate::query_intermediate;
|
|
|
|
result fetch_all();
|
|
result fetch_one();
|
|
result fetch_value();
|
|
};
|
|
|
|
struct query_order_direction_intermediate : query_finish
|
|
{
|
|
using query_finish::query_finish;
|
|
};
|
|
|
|
struct query_group_by_intermediate : query_finish
|
|
{
|
|
using query_finish::query_finish;
|
|
|
|
|
|
};
|
|
struct query_order_by_intermediate : query_intermediate
|
|
{
|
|
using query_intermediate::query_intermediate;
|
|
query_order_direction_intermediate asc();
|
|
query_order_direction_intermediate desc();
|
|
|
|
};
|
|
|
|
struct query_where_intermediate : query_finish
|
|
{
|
|
using query_finish::query_finish;
|
|
};
|
|
|
|
struct query_from_intermediate : query_finish
|
|
{
|
|
using query_finish::query_finish;
|
|
|
|
query_where_intermediate where(const basic_condition &cond);
|
|
query_group_by_intermediate group_by(const std::string &name);
|
|
query_order_by_intermediate order_by(const std::string &name);
|
|
};
|
|
|
|
struct query_select_intermediate : query_intermediate
|
|
{
|
|
using query_intermediate::query_intermediate;
|
|
|
|
query_from_intermediate from(const std::string &table, const std::string &as = "");
|
|
|
|
};
|
|
|
|
}
|
|
#endif //QUERY_CONNECTION_INTERMEDIATES_HPP
|