diff -r ec793cb3e686 -r 49919a60c747 src/PreparedStatement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/PreparedStatement.h Wed Dec 25 00:57:26 2019 +0100 @@ -0,0 +1,85 @@ +/** + * 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" + +namespace relpipe { +namespace tr { +namespace sql { + +using namespace std; +using namespace relpipe; +using namespace relpipe::reader; +using namespace relpipe::reader::handlers; + +class PreparedStatement { +private: + sqlite3_stmt* stmt; + +public: + + PreparedStatement(sqlite3_stmt* stmt); + + virtual ~PreparedStatement(); + + void setBoolean(int parameterIndex, relpipe::reader::boolean_t value); + + void setInteger(int parameterIndex, relpipe::reader::integer_t value); + + void setString(int parameterIndex, std::string value); + + void setNull(int parameterIndex); + + bool next(); + + void reset(); + + int getColumnCount(); + + std::string getColumName(int columnIndex); + + relpipe::writer::TypeId getColumType(int columnIndex, relpipe::writer::TypeId defaultType = relpipe::writer::TypeId::STRING); + + std::string getString(int columnIndex); + +}; + +} +} +}