#ifndef HISTORY_DATABASE_SQLITE_H
#define HISTORY_DATABASE_SQLITE_H

#include "history_database_base.h"
#include <QSqlDatabase>


class SHSHistoryDatabaseSQLite: public SHSHistoryDatabaseBase {
	Q_OBJECT
public:
	explicit SHSHistoryDatabaseSQLite();
	~SHSHistoryDatabaseSQLite();
	
public:
	QPolygonF readHistory(int id) override;

protected:
	bool init(QString filename, const QList<SHSHistoryDatabaseBase::Variable> & vars) override;
	void destroy() override;
	void writeRows(int var_id, const QList<SHSHistoryDatabaseBase::HistoryRow> & rows) override;
	void removeOldRows(int var_id) override;
	void transaction() override;
	void commit() override;

	QSqlDatabase db;

};

#endif
