2014-12-15 16:43:32 +01:00
|
|
|
#ifndef __PREPARE_STATEMENT_H__
|
|
|
|
#define __PREPARE_STATEMENT_H__
|
|
|
|
|
2016-02-27 14:24:23 +01:00
|
|
|
#include "../SQLParserResult.h"
|
2014-12-15 16:43:32 +01:00
|
|
|
#include "SQLStatement.h"
|
|
|
|
#include "SelectStatement.h"
|
2015-01-06 15:29:18 +01:00
|
|
|
#include <algorithm>
|
2014-12-15 16:43:32 +01:00
|
|
|
|
|
|
|
namespace hsql {
|
2016-02-27 15:01:06 +01:00
|
|
|
/**
|
2016-02-27 15:22:22 +01:00
|
|
|
* Represents SQL Prepare statements.
|
|
|
|
* Example: "PREPARE ins_prep: SELECT * FROM t1 WHERE c1 = ? AND c2 = ?"
|
2016-02-27 15:01:06 +01:00
|
|
|
*/
|
|
|
|
struct PrepareStatement : SQLStatement {
|
2017-02-03 16:50:18 +01:00
|
|
|
PrepareStatement();
|
|
|
|
virtual ~PrepareStatement();
|
2016-02-27 15:01:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When setting the placeholders we need to make sure that they are in the correct order.
|
|
|
|
* To ensure that, during parsing we store the character position use that to sort the list here.
|
2016-02-27 15:22:22 +01:00
|
|
|
*
|
|
|
|
* @param vector of placeholders that the parser found
|
2016-02-27 15:01:06 +01:00
|
|
|
*/
|
2017-02-03 16:50:18 +01:00
|
|
|
void setPlaceholders(std::vector<void*> ph);
|
2016-02-27 15:01:06 +01:00
|
|
|
|
|
|
|
const char* name;
|
|
|
|
SQLParserResult* query;
|
|
|
|
std::vector<Expr*> placeholders;
|
|
|
|
};
|
2014-12-15 16:43:32 +01:00
|
|
|
|
|
|
|
} // namsepace hsql
|
|
|
|
#endif
|