add options --data-source-name and --data-source-url for custom datasource; drop options --file and --file-keep
/**
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <list>
#include <string>
#include <utility>
#include <relpipe/reader/typedefs.h>
#include <relpipe/reader/TypeId.h>
#include <relpipe/writer/TypeId.h>
#include "SqlException.h"
#include "ResultSet.h"
namespace relpipe {
namespace tr {
namespace sql {
class PreparedStatement {
private:
void* statement;
std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings
std::list<relpipe::reader::boolean_t> booleanParameters;
std::list<relpipe::reader::integer_t> integerParameters;
std::list<std::pair<std::string, long>> stringParameters;
public:
PreparedStatement(void* stmt);
virtual ~PreparedStatement();
ResultSet* executeQuery();
long executeUpdate();
void reset();
void setBoolean(int parameterNumber, relpipe::reader::boolean_t value);
void setInteger(int parameterNumber, relpipe::reader::integer_t value);
void setString(int parameterNumber, relpipe::reader::string_t value);
void setNull(int parameterNumber);
};
}
}
}