#pragma once

#include <string>

class SQL
{
public:
    enum class TYPE
    {
        insert = 1,
        select,
        update,
        del,
    };

    SQL(TYPE t = TYPE::select) : type(t) {}

    std::string str();

    SQL& table(std::string t);

    SQL& select(std::string k);

    SQL& where(std::string expr);

    SQL& update(std::string k, std::string v);

    SQL& insert(std::string k, std::string v);

private:
    TYPE type = TYPE::select;
    std::string tabname;
    std::string sql_k;
    std::string sql_v;
    std::string sql_c;
};