Nut/src/query_p.h

66 lines
1.7 KiB
C
Raw Normal View History

2016-06-05 20:22:26 +08:00
/**************************************************************************
**
** This file is part of Nut project.
** https://github.com/HamedMasafi/Nut
**
** Nut is free software: you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Nut is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with Nut. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************/
#ifndef QUERY_P_H
#define QUERY_P_H
2018-02-17 23:44:39 +08:00
#include "phrase.h"
2016-06-05 20:22:26 +08:00
2019-06-18 21:40:40 +08:00
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QSharedData>
2016-06-05 20:22:26 +08:00
2017-02-01 18:01:21 +08:00
NUT_BEGIN_NAMESPACE
2016-06-05 20:22:26 +08:00
class Database;
class TableSetBase;
class QueryBase;
2018-03-11 21:13:13 +08:00
struct RelationModel;
2019-06-18 21:40:40 +08:00
class QueryPrivate : public QSharedData {
2016-06-05 20:22:26 +08:00
QueryBase *q_ptr;
Q_DECLARE_PUBLIC(QueryBase)
public:
2018-02-26 18:14:36 +08:00
explicit QueryPrivate(QueryBase *parent);
2019-07-20 14:37:08 +08:00
~QueryPrivate();
2017-06-01 23:38:53 +08:00
2017-07-25 22:10:43 +08:00
QString sql;
2018-01-11 17:36:48 +08:00
QString className;
2016-06-05 20:22:26 +08:00
QString tableName;
QString select;
Database *database;
TableSetBase *tableSet;
2018-01-10 01:32:28 +08:00
QStringList joins;
2018-01-13 23:59:55 +08:00
QList<RelationModel*> relations;
2017-08-24 23:35:23 +08:00
int skip;
int take;
2018-02-17 23:44:39 +08:00
PhraseList orderPhrase, fieldPhrase;
ConditionalPhrase wherePhrase;
// QList<WherePhrase> wheres;
// QList<WherePhrase> orderPhrases;
// QList<WherePhrase> fields;
// QHash<QString, QString> orders;
2016-06-05 20:22:26 +08:00
};
2017-02-01 18:01:21 +08:00
NUT_END_NAMESPACE
2016-06-05 20:22:26 +08:00
#endif // QUERY_P_H