2 #include <samchon/API.hpp> 6 #include <samchon/Map.hpp> 8 #include <samchon/ByteArray.hpp> 49 typedef long long SQL_SIZE_T;
51 typedef long SQL_SIZE_T;
97 void reset(
SQLi *sqli);
125 template <
typename T,
typename ... _Args>
126 void prepare(
const std::string &sql,
const T& val,
const _Args& ... args)
131 bindParameter(args...);
133 template <
typename T>
void prepare(
const std::string &str,
const T& val)
139 void prepare(
const std::string &);
140 void prepare(
const std::wstring &);
142 template <
typename T,
typename ... _Args>
143 void prepare(
const std::wstring &sql,
const T& val,
const _Args& ... args)
148 bindParameter(args...);
150 template <
typename T>
void prepare(
const std::wstring &str,
const T& val)
180 void executeDirectly(
const std::string&);
181 void executeDirectly(
const std::wstring&);
193 auto fetch()
const -> bool;
200 auto next()
const -> bool;
211 auto size()
const -> size_t;
220 template <
typename T>
auto at(
size_t index)
const -> T
223 sql_get_data(index + 1, C_TYPE(T()), &val);
227 template<>
auto at(
size_t index)
const -> std::string
229 return _atAsString(index);
231 template<>
auto at(
size_t index)
const -> std::wstring
233 return _atAsWString(index);
235 template<>
auto at(
size_t index)
const ->
ByteArray 237 return _atAsByteArray(index);
247 template <
typename T>
auto get(
const std::string &)
const -> T
249 return this->at<T>(0);
261 virtual auto toXML()
const->std::shared_ptr<
XML>;
267 template <
typename T,
typename ... _Args>
268 void bindParameter(
const T& val,
const _Args& ... args)
271 bindParameter(args...);
273 template <
typename T>
void bindParameter(
const T &val)
275 sql_bind_parameter(C_TYPE(val), SQL_TYPE(val), (
void*)&val);
277 template<>
void bindParameter(
const std::string &val);
278 template<>
void bindParameter(
const std::wstring &val);
279 template<>
void bindParameter(
const ByteArray &val);
284 void sql_get_data(
size_t,
short,
void*)
const;
285 void sql_bind_parameter(
short,
short,
void*);
287 template <
typename T>
auto C_TYPE(
const T &)
const -> short;
288 template<>
auto C_TYPE(
const bool &)
const -> short;
289 template<>
auto C_TYPE(
const char &)
const -> short;
290 template<>
auto C_TYPE(
const short &)
const -> short;
291 template<>
auto C_TYPE(
const long &)
const -> short;
292 template<>
auto C_TYPE(
const long long &)
const -> short;
293 template<>
auto C_TYPE(
const int &)
const -> short;
294 template<>
auto C_TYPE(
const float &)
const -> short;
295 template<>
auto C_TYPE(
const double &)
const -> short;
297 template<>
auto C_TYPE(
const unsigned char &)
const -> short;
298 template<>
auto C_TYPE(
const unsigned short &)
const -> short;
299 template<>
auto C_TYPE(
const unsigned long &)
const -> short;
300 template<>
auto C_TYPE(
const unsigned long long &)
const -> short;
301 template<>
auto C_TYPE(
const unsigned int &)
const -> short;
302 template<>
auto C_TYPE(
const long double &)
const -> short;
304 template<>
auto C_TYPE(
const std::string &)
const -> short;
305 template<>
auto C_TYPE(
const std::wstring &)
const -> short;
306 template<>
auto C_TYPE(
const ByteArray &)
const -> short;
308 template <
typename T>
auto SQL_TYPE(
const T &)
const -> short;
309 template<>
auto SQL_TYPE(
const bool &)
const -> short;
310 template<>
auto SQL_TYPE(
const char &)
const -> short;
311 template<>
auto SQL_TYPE(
const short &)
const -> short;
312 template<>
auto SQL_TYPE(
const long &)
const -> short;
313 template<>
auto SQL_TYPE(
const long long &)
const -> short;
314 template<>
auto SQL_TYPE(
const int &)
const -> short;
315 template<>
auto SQL_TYPE(
const float &)
const -> short;
316 template<>
auto SQL_TYPE(
const double &)
const -> short;
318 template<>
auto SQL_TYPE(
const unsigned char &)
const -> short;
319 template<>
auto SQL_TYPE(
const unsigned short &)
const -> short;
320 template<>
auto SQL_TYPE(
const unsigned long &)
const -> short;
321 template<>
auto SQL_TYPE(
const unsigned long long &)
const -> short;
322 template<>
auto SQL_TYPE(
const unsigned int &)
const -> short;
323 template<>
auto SQL_TYPE(
const long double &)
const -> short;
325 template<>
auto SQL_TYPE(
const std::string &)
const -> short;
326 template<>
auto SQL_TYPE(
const std::wstring &)
const -> short;
327 template<>
auto SQL_TYPE(
const ByteArray &)
const -> short;
333 auto _atAsString(
size_t index)
const -> std::string;
334 auto _atAsWString(
size_t index)
const -> std::wstring;
336 auto _atAsByteArray(
size_t index)
const ->
ByteArray;
void * hstmt
Handler of sql statement (OBDC)
size_t bindParameterCount
Count of binded parameters .
auto at(size_t index) const -> T
Get column's data by its index.
SQLi * sqli
SQLi who created the SQLStatement.
A SQL interface; DBMS connector.
Map< size_t, SQL_SIZE_T > bindParameterBASizeMap
A map for binary size.
XML is a class representing xml object.
Top level namespace of products built from samchon.
void prepare(const std::string &sql, const T &val, const _Args &...args)
Prepare a sql statement.