diff -r 49919a60c747 -r 9441a517fa1f src/Connection.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Connection.h Wed Dec 25 01:07:41 2019 +0100 @@ -0,0 +1,68 @@ +/** + * Relational pipes + * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include "Configuration.h" +#include "SqlException.h" +#include "PreparedStatement.h" + +namespace relpipe { +namespace tr { +namespace sql { + +using namespace std; +using namespace relpipe; +using namespace relpipe::reader; +using namespace relpipe::reader::handlers; + +class Connection { +private: + sqlite3* db; + void begin(); +public: + Connection(const char* filename); + virtual ~Connection(); + PreparedStatement* prepareStatement(const char* sql); + bool getAutoCommit(); + void setAutoCommit(bool autoCommit); + void commit(); + void rollback(); +}; + +} +} +}