1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#ifndef SQLITEUPDATE_H
#define SQLITEUPDATE_H
#include "sqlitequery.h"
#include "sqliteconflictalgo.h"
#include "sqliteselect.h"
#include "sqlitequerywithaliasedtable.h"
#include <QStringList>
#include <QMap>
class SqliteExpr;
class SqliteWith;
class API_EXPORT SqliteUpdate : public SqliteQuery, SqliteQueryWithAliasedTable
{
Q_OBJECT
public:
typedef QPair<QVariant,SqliteExpr*> ColumnAndValue;
SqliteUpdate();
SqliteUpdate(const SqliteUpdate& other);
~SqliteUpdate();
SqliteUpdate(SqliteConflictAlgo onConflict, const QString& name1, const QString& name2, const QString& alias,
bool notIndexedKw, const QString& indexedBy, const QList<ColumnAndValue>& values,
SqliteSelect::Core::JoinSource* from, SqliteExpr* where, SqliteWith* with, const QList<SqliteResultColumn*>& returning,
const QList<SqliteOrderBy*>& orderBy, SqliteLimit* limit);
SqliteStatement* clone();
SqliteExpr* getValueForColumnSet(const QString& column);
QString getTable() const;
QString getDatabase() const;
QString getTableAlias() const;
SqliteConflictAlgo onConflict = SqliteConflictAlgo::null;
QString database = QString();
QString table = QString();
QString tableAlias = QString();
bool indexedByKw = false;
bool notIndexedKw = false;
QString indexedBy = QString();
QList<ColumnAndValue> keyValueMap;
SqliteSelect::Core::JoinSource* from = nullptr;
SqliteExpr* where = nullptr;
SqliteWith* with = nullptr;
QList<SqliteResultColumn*> returning;
QList<SqliteOrderBy*> orderBy;
SqliteLimit* limit = nullptr;
protected:
QStringList getColumnsInStatement();
QStringList getTablesInStatement();
QStringList getDatabasesInStatement();
TokenList getColumnTokensInStatement();
TokenList getTableTokensInStatement();
TokenList getDatabaseTokensInStatement();
QList<FullObject> getFullObjectsInStatement();
TokenList rebuildTokensFromContents();
};
typedef QSharedPointer<SqliteUpdate> SqliteUpdatePtr;
#endif // SQLITEUPDATE_H
|