#pragma once
#include <drogon/orm/FilterBuilder.h>
#include <string>
namespace drogon
{
namespace orm
{
template <typename T>
class QueryBuilder : public FilterBuilder<T, true>
{
    inline const std::string &getTableName() const
    {
        return this->from_.empty() ? T::tableName : this->from_;
    }
  public:
    inline QueryBuilder &from(const std::string &table)
    {
        this->from_ = table;
        return *this;
    }
    inline FilterBuilder<T, false> select(const std::string &columns) const
    {
        return {getTableName(), columns};
    }
    inline FilterBuilder<T, true> selectAll() const
    {
        return {getTableName(), "*"};
    }
};
}  
}  