Adds q2 repos to migrate
This commit is contained in:
1 parent
ad1f62c4ee
commit
17f1c61c9e
991 files changed
+178451
No files matched your search
Executable
+222
@@ -0,0 +1,222 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtSql/QSqlQuery>
|
||||
|
||||
#include "ngldb_export.h"
|
||||
#include "dbcommon.h"
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
class QDateTime;
|
||||
class QJsonValue;
|
||||
|
||||
|
||||
|
||||
class NGLDB_EXPORT NSqlQuery final : public QSqlQuery
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
explicit NSqlQuery(const QSqlDatabase &db);
|
||||
explicit NSqlQuery(const QSqlDatabase &db, NGL::INGLLogger &logger);
|
||||
explicit NSqlQuery(const QString &query, const QSqlDatabase &db);
|
||||
explicit NSqlQuery(const QString &query, const QSqlDatabase &db, NGL::INGLLogger &logger);
|
||||
|
||||
|
||||
|
||||
NSqlQuery(const NSqlQuery &other) = default;
|
||||
|
||||
|
||||
|
||||
~NSqlQuery() = default;
|
||||
|
||||
|
||||
|
||||
void addBindValue(const QVariant &val, QSql::ParamType paramType = QSql::In);
|
||||
|
||||
|
||||
|
||||
int at() const;
|
||||
|
||||
|
||||
|
||||
void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType paramType = QSql::In);
|
||||
|
||||
|
||||
|
||||
void bindValue(int pos, const QVariant &val, QSql::ParamType paramType = QSql::In);
|
||||
|
||||
|
||||
|
||||
QVariant boundValue(const QString &placeholder) const;
|
||||
|
||||
|
||||
|
||||
QVariant boundValue(int pos) const;
|
||||
|
||||
|
||||
|
||||
QMap<QString, QVariant> boundValues() const;
|
||||
|
||||
|
||||
|
||||
void clear();
|
||||
|
||||
|
||||
|
||||
const QSqlDriver *driver() const;
|
||||
|
||||
|
||||
|
||||
bool exec(const QString &query, bool bEmitMessageOnError = true);
|
||||
|
||||
|
||||
|
||||
bool exec(bool bEmitMessageOnError = true);
|
||||
|
||||
|
||||
|
||||
bool execAndFetch();
|
||||
|
||||
|
||||
|
||||
bool execAndFetch(const QString &query);
|
||||
|
||||
|
||||
|
||||
bool execBatch(BatchExecutionMode mode = ValuesAsRows);
|
||||
|
||||
|
||||
|
||||
QString executedQuery() const;
|
||||
|
||||
|
||||
|
||||
void finish();
|
||||
|
||||
|
||||
|
||||
bool first();
|
||||
|
||||
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
|
||||
|
||||
bool isForwardOnly() const;
|
||||
|
||||
|
||||
|
||||
bool isNull(int field) const;
|
||||
|
||||
|
||||
|
||||
bool isSelect() const;
|
||||
|
||||
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
|
||||
|
||||
bool last();
|
||||
|
||||
|
||||
|
||||
QSqlError lastError() const;
|
||||
|
||||
QString sqlstate();
|
||||
|
||||
|
||||
QVariant lastInsertId();
|
||||
|
||||
|
||||
|
||||
QString lastQuery() const;
|
||||
|
||||
|
||||
|
||||
bool next();
|
||||
|
||||
|
||||
|
||||
bool nextResult();
|
||||
|
||||
|
||||
|
||||
int numRowsAffected() const;
|
||||
|
||||
|
||||
|
||||
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
|
||||
|
||||
|
||||
|
||||
bool prepare(const QString &query);
|
||||
|
||||
|
||||
|
||||
bool previous();
|
||||
|
||||
|
||||
|
||||
QSqlRecord record() const;
|
||||
|
||||
|
||||
|
||||
const QSqlResult *result() const;
|
||||
|
||||
|
||||
|
||||
bool seek(int index, bool relative = false);
|
||||
|
||||
|
||||
|
||||
void setForwardOnly(bool forward);
|
||||
|
||||
|
||||
|
||||
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
|
||||
|
||||
|
||||
|
||||
int size() const;
|
||||
|
||||
|
||||
|
||||
QVariant value(int index) const;
|
||||
|
||||
|
||||
|
||||
NSqlQuery &operator= (const NSqlQuery &other);
|
||||
|
||||
bool export2CSV(const QString &filename);
|
||||
|
||||
|
||||
|
||||
static QVariant qDateTimeToQVariant(const QDateTime &dt);
|
||||
|
||||
|
||||
static QDateTime qVariantToQDateTime(const QVariant &var);
|
||||
|
||||
|
||||
static QString qVariantToJsonString(const QVariant &value);
|
||||
|
||||
|
||||
static QString jsonValueToJsonString(const QJsonValue &value);
|
||||
|
||||
static inline QString fixupEmptyJsonString(const QString &str) { return str.isEmpty() ? QLatin1String("{}") : str; }
|
||||
|
||||
QString getLastSqlError();
|
||||
|
||||
private:
|
||||
void printLastSqlError();
|
||||
QSqlDatabase m_db;
|
||||
NGL::INGLLogger &mLogger;
|
||||
};
|
||||
Reference in new issue
Block a user