
/*-----------------------------------------------------------------------------------------------*/
/* tasks_sqlconsole.h                                                                            */
/* copyright (c) innovaphone 2022                                                                */
/*                                                                                               */
/*-----------------------------------------------------------------------------------------------*/

class TaskSqlConsoleExec : public ITask, public UDatabase {
    class IDatabase * database;
    class IDataSet * dataset;
    const char * query;
    long64 start;
    long64 total;

    void DatabaseExecSQLResult(IDatabase * const database, class IDataSet * dataset);
    void DatabaseError(IDatabase * const database, db_error_t error);
public:
    TaskSqlConsoleExec(IDatabase * database, const char * query);
    ~TaskSqlConsoleExec();
    void Start(class UTask * user);
    void Json(class json_io & json, word base, char * & tmp);
    void Next();
    long64 getTotal() { return total; };
};
