query/include/matador/sql/session.hpp

32 lines
782 B
C++

#ifndef QUERY_SESSION_HPP
#define QUERY_SESSION_HPP
#include "matador/sql/connection.hpp"
#include "matador/sql/connection_pool.hpp"
namespace matador::sql {
class session
{
public:
explicit session(connection_pool<connection> &pool);
query_create_intermediate create();
query_drop_intermediate drop();
query_select_intermediate select(std::initializer_list<std::string> column_names);
query_insert_intermediate insert();
query_update_intermediate update(const std::string &table);
query_delete_intermediate remove();
query_result<record> fetch(const std::string &sql);
std::pair<size_t, std::string> execute(const std::string &sql);
private:
connection_pool<connection> &pool_;
dialect dialect_;
query_builder query_;
};
}
#endif //QUERY_SESSION_HPP