Added delete support to the CRUD system.
This commit is contained in:
parent
36f5153091
commit
8c20bd6a02
8 changed files with 230 additions and 89 deletions
|
|
@ -10,6 +10,21 @@
|
|||
|
||||
namespace Pgsql {
|
||||
|
||||
class Params;
|
||||
|
||||
class Param {
|
||||
public:
|
||||
Param(Params ¶ms, int index)
|
||||
: params(params)
|
||||
, index(index)
|
||||
{}
|
||||
|
||||
int getIndex() const { return index; }
|
||||
private:
|
||||
Params ¶ms;
|
||||
int index;
|
||||
};
|
||||
|
||||
class Params {
|
||||
public:
|
||||
Params();
|
||||
|
|
@ -20,11 +35,11 @@ namespace Pgsql {
|
|||
~Params();
|
||||
|
||||
|
||||
void add(const QString &s, Oid oid=varchar_oid);
|
||||
void add(const char *data, Oid oid=varchar_oid);
|
||||
void add(boost::optional<std::string> s, Oid oid=varchar_oid)
|
||||
Param add(const QString &s, Oid oid=varchar_oid);
|
||||
Param add(const char *data, Oid oid=varchar_oid);
|
||||
Param add(boost::optional<std::string> s, Oid oid=varchar_oid)
|
||||
{
|
||||
add(s ? s->c_str() : nullptr, oid);
|
||||
return add(s ? s->c_str() : nullptr, oid);
|
||||
}
|
||||
//void addBinary(const char *data, int length, Oid oid);
|
||||
void clear();
|
||||
|
|
@ -58,7 +73,7 @@ namespace Pgsql {
|
|||
*
|
||||
* The class takes ownership of data and will try to delete[] it.
|
||||
*/
|
||||
void addText(const char *data, Oid oid=VARCHAROID);
|
||||
Param addText(const char *data, Oid oid=VARCHAROID);
|
||||
};
|
||||
|
||||
} // end namespace Pgsql
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue