#include <InsertQuery.h>
Public Member Functions | |
InsertQuery (const DatabaseConnection &db, const String &sql="", const String &idFieldName="id") | |
String | sql () const override |
void | sql (const String &_sql) override |
void | exec () override |
void | exec (const String &newSQL) override |
uint64_t | id () const |
Public Member Functions inherited from sptk::Query | |
Query () noexcept | |
Query (const DatabaseConnection &db, const String &sql="", bool autoPrepare=true) | |
Query (PoolDatabaseConnection *db, const String &sql="", bool autoPrepare=true) | |
Query (const Query &)=delete | |
Query & | operator= (const Query &)=delete |
~Query () override | |
Field & | operator[] (size_t fieldIndex) override |
Field & | operator[] (const String &fieldName) override |
size_t | fieldCount () const override |
size_t | recordCount () const override |
virtual String | sql () const |
virtual void | sql (const String &_sql) |
FieldList & | fields () |
QueryParameterList & | params () |
bool | readField (const char *fname, Variant &value) override |
bool | writeField (const char *fname, const Variant &fvalue) override |
bool | open () override |
bool | close () override |
bool | next () override |
virtual void | exec () |
virtual void | exec (const String &newSQL) |
void | fetch () |
size_t | paramCount () const |
QueryParameter & | param (const char *paramName) const |
QueryParameter & | param (const String ¶mName) const |
QueryParameter & | param (size_t paramIndex) const |
Public Member Functions inherited from sptk::QueryStatementManagement | |
QueryStatementManagement (bool autoPrepare) | |
QueryStatementManagement (const QueryStatementManagement &other)=delete | |
StmtHandle | statement () const |
bool | autoPrepare () const |
bool | active () const |
bool | prepared () const |
bool | eof () const override |
bool | bulkMode () const |
void | connect (PoolDatabaseConnection *db) |
void | disconnect () |
PoolDatabaseConnection * | database () const |
void | database (PoolDatabaseConnection *db) |
Public Member Functions inherited from sptk::DataSource | |
DataSource ()=default | |
virtual | ~DataSource ()=default |
virtual Field & | operator[] (size_t fieldIndex)=0 |
virtual Field & | operator[] (const String &fieldName)=0 |
virtual size_t | fieldCount () const =0 |
virtual size_t | recordCount () const =0 |
virtual bool | readField (const char *fieldName, Variant &fieldValue)=0 |
virtual bool | writeField (const char *fieldName, const Variant &fieldValue)=0 |
virtual bool | open () |
virtual bool | close () |
virtual bool | first () |
virtual bool | next () |
virtual bool | prior () |
virtual bool | last () |
virtual bool | find (const String &, const Variant &) |
virtual bool | eof () const |
bool | load () |
bool | save () |
void | exportRowTo (const xdoc::SNode &node, bool compactXmlMode, bool nullLargeData=false) |
virtual void | exportTo (xdoc::Node &parentNode, const String &nodeName, bool compactXmlMode) |
Additional Inherited Members | |
Static Public Member Functions inherited from sptk::Query | |
static void | throwError (const String &method, const String &error) |
Protected Member Functions inherited from sptk::Query | |
void | execute () |
bool | loadData () override |
bool | saveData () override |
Protected Member Functions inherited from sptk::QueryStatementManagement | |
void | setDatabase (PoolDatabaseConnection *db) |
void | setStatement (StmtHandle statement) |
void | setPrepared (bool prepared) |
void | setActive (bool active) |
void | setEof (bool eof) |
void | setBulkMode (bool _bulkMode) |
void | closeStmt (bool freeStatement=false) |
void | closeQuery (bool releaseStatement=false) |
Strings & | messages () |
String & | getSQL () |
const String & | getSQL () const |
void | setSQL (const String &sql) |
void | notImplemented (const String &functionName) const |
virtual bool | loadData () |
virtual bool | saveData () |
Database query
A Dataset connected to the database to execute a database queries. The type of the database depends on the DatabaseConnection object query is connected to.