Formats minimally release source files based on former clang-format
This commit is contained in:
387 files changed
+37323
-38074
No files matched your search
Executable → Regular
+38
-39
@@ -8,51 +8,50 @@
|
||||
class QSqlDatabase;
|
||||
namespace NGLDB
|
||||
{
|
||||
template<typename DB>
|
||||
class DbServiceHandler
|
||||
{
|
||||
public:
|
||||
DbServiceHandler() = default;
|
||||
~DbServiceHandler() = default;
|
||||
|
||||
|
||||
bool init(int exerciseId, NGL::Settings *settings)
|
||||
template <typename DB> class DbServiceHandler
|
||||
{
|
||||
if (m_dbInterface)
|
||||
return true;
|
||||
public:
|
||||
DbServiceHandler() = default;
|
||||
~DbServiceHandler() = default;
|
||||
|
||||
m_dbInterface = DB::create(exerciseId);
|
||||
|
||||
if (!m_dbInterface->init(m_dbInterface->dbUser(),
|
||||
settings->databasePassword(m_dbInterface->dbUser()),
|
||||
settings->databaseDriver(),
|
||||
settings->databaseHostname(),
|
||||
settings->databaseName()))
|
||||
bool init(int exerciseId, NGL::Settings *settings)
|
||||
{
|
||||
m_dbInterface = nullptr;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (m_dbInterface)
|
||||
return true;
|
||||
|
||||
bool init(int exerciseId, const QSqlDatabase &db)
|
||||
{
|
||||
if (m_dbInterface)
|
||||
m_dbInterface = DB::create(exerciseId);
|
||||
|
||||
if (!m_dbInterface->init(m_dbInterface->dbUser(),
|
||||
settings->databasePassword(m_dbInterface->dbUser()),
|
||||
settings->databaseDriver(),
|
||||
settings->databaseHostname(),
|
||||
settings->databaseName()))
|
||||
{
|
||||
m_dbInterface = nullptr;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
m_dbInterface = DB::create(exerciseId);
|
||||
|
||||
if (!m_dbInterface->init(db))
|
||||
{
|
||||
m_dbInterface = nullptr;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<DB> db() const { return m_dbInterface; }
|
||||
bool init(int exerciseId, const QSqlDatabase &db)
|
||||
{
|
||||
if (m_dbInterface)
|
||||
return true;
|
||||
|
||||
private:
|
||||
std::shared_ptr<DB> m_dbInterface;
|
||||
};
|
||||
}
|
||||
m_dbInterface = DB::create(exerciseId);
|
||||
|
||||
if (!m_dbInterface->init(db))
|
||||
{
|
||||
m_dbInterface = nullptr;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<DB> db() const { return m_dbInterface; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<DB> m_dbInterface;
|
||||
};
|
||||
}
|
||||
Executable → Regular
+18
-22
@@ -7,35 +7,31 @@
|
||||
#include <QtCore/QString>
|
||||
|
||||
|
||||
|
||||
namespace DBCommon
|
||||
{
|
||||
|
||||
enum class eDatabaseSchema
|
||||
{
|
||||
Exercise
|
||||
};
|
||||
enum class eDatabaseSchema
|
||||
{
|
||||
Exercise
|
||||
};
|
||||
|
||||
|
||||
inline QString getExerciseSchemaName(int exerciseId)
|
||||
{
|
||||
return QLatin1String("ex_") + QString::number(exerciseId);
|
||||
}
|
||||
|
||||
inline QString getExerciseSchemaName(int exerciseId)
|
||||
{
|
||||
return QLatin1String("ex_") + QString::number(exerciseId);
|
||||
}
|
||||
|
||||
inline QString getTableName(const QString &tableName, const QString &schemaName)
|
||||
{
|
||||
if (schemaName.isEmpty())
|
||||
return tableName;
|
||||
return schemaName + QLatin1Char('.') + tableName;
|
||||
}
|
||||
|
||||
|
||||
inline QString getTableName(const QString &tableName, const QString &schemaName)
|
||||
{
|
||||
if (schemaName.isEmpty())
|
||||
return tableName;
|
||||
return schemaName + QLatin1Char('.') + tableName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QString getExerciseTableName(const QString &tableName, int exerciseId)
|
||||
{
|
||||
return getTableName(tableName, getExerciseSchemaName(exerciseId));
|
||||
}
|
||||
inline QString getExerciseTableName(const QString &tableName, int exerciseId)
|
||||
{
|
||||
return getTableName(tableName, getExerciseSchemaName(exerciseId));
|
||||
}
|
||||
}
|
||||
Executable → Regular
+44
-47
@@ -11,58 +11,55 @@
|
||||
namespace DBConnection
|
||||
{
|
||||
|
||||
QSqlDatabase open(NGL::INGLLogger &logger,
|
||||
const QString &dbUser,
|
||||
const QString &dbPasswd,
|
||||
const QString &dbDriver,
|
||||
const QString &dbHost,
|
||||
const QString &dbName,
|
||||
const QString &schemaName,
|
||||
const QString &connectionName)
|
||||
{
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG(logger) << "host: " << dbHost << " database: " << dbName;
|
||||
QString realConnectionName(connectionName);
|
||||
if (connectionName.isEmpty())
|
||||
QSqlDatabase open(NGL::INGLLogger &logger,
|
||||
const QString &dbUser,
|
||||
const QString &dbPasswd,
|
||||
const QString &dbDriver,
|
||||
const QString &dbHost,
|
||||
const QString &dbName,
|
||||
const QString &schemaName,
|
||||
const QString &connectionName)
|
||||
{
|
||||
realConnectionName = dbHost + QLatin1Char('_') + dbName;
|
||||
|
||||
|
||||
DEBUG_LOG(logger) << "host: " << dbHost << " database: " << dbName;
|
||||
QString realConnectionName(connectionName);
|
||||
if (connectionName.isEmpty())
|
||||
{
|
||||
realConnectionName = dbHost + QLatin1Char('_') + dbName;
|
||||
if (!schemaName.isEmpty())
|
||||
realConnectionName += QLatin1Char('_') + schemaName;
|
||||
}
|
||||
|
||||
auto dbConnection = QSqlDatabase::addDatabase(dbDriver, realConnectionName);
|
||||
dbConnection.setHostName(dbHost);
|
||||
dbConnection.setDatabaseName(dbName);
|
||||
dbConnection.setUserName(dbUser);
|
||||
dbConnection.setPassword(dbPasswd);
|
||||
|
||||
if (!dbConnection.open())
|
||||
{
|
||||
const QString err = dbConnection.lastError().nativeErrorCode();
|
||||
FATAL_LOG(logger) << "Error opening database " << dbHost << ":" << dbName << " as user " << dbUser;
|
||||
FATAL_LOG(logger) << dbConnection.lastError().driverText() << " " << dbConnection.lastError().databaseText() << " " << err;
|
||||
return dbConnection;
|
||||
}
|
||||
|
||||
DEBUG_LOG(logger) << "Database Initialisation successful -> DB: " << dbName << ", con: " << realConnectionName;
|
||||
|
||||
if (!schemaName.isEmpty())
|
||||
realConnectionName += QLatin1Char('_') + schemaName;
|
||||
}
|
||||
{
|
||||
const QString stmt = QLatin1String("SET SEARCH_PATH TO ") + schemaName + QLatin1String(", PUBLIC");
|
||||
|
||||
auto dbConnection = QSqlDatabase::addDatabase(dbDriver, realConnectionName);
|
||||
dbConnection.setHostName(dbHost);
|
||||
dbConnection.setDatabaseName(dbName);
|
||||
dbConnection.setUserName(dbUser);
|
||||
dbConnection.setPassword(dbPasswd);
|
||||
NSqlQuery q(dbConnection);
|
||||
if (!q.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(logger) << "Set SEARCH_PATH to " << schemaName << " failed!";
|
||||
dbConnection.close();
|
||||
}
|
||||
}
|
||||
|
||||
if (!dbConnection.open())
|
||||
{
|
||||
const QString err = dbConnection.lastError().nativeErrorCode();
|
||||
FATAL_LOG(logger) << "Error opening database " << dbHost
|
||||
<< ":" << dbName << " as user " << dbUser;
|
||||
FATAL_LOG(logger) << dbConnection.lastError().driverText() << " "
|
||||
<< dbConnection.lastError().databaseText() << " " << err;
|
||||
return dbConnection;
|
||||
}
|
||||
|
||||
DEBUG_LOG(logger) << "Database Initialisation successful -> DB: " << dbName << ", con: " << realConnectionName;
|
||||
|
||||
if (!schemaName.isEmpty())
|
||||
{
|
||||
const QString stmt = QLatin1String("SET SEARCH_PATH TO ") + schemaName + QLatin1String(", PUBLIC");
|
||||
|
||||
NSqlQuery q(dbConnection);
|
||||
if (!q.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(logger) << "Set SEARCH_PATH to " << schemaName << " failed!";
|
||||
dbConnection.close();
|
||||
}
|
||||
}
|
||||
|
||||
return dbConnection;
|
||||
}
|
||||
|
||||
}
|
||||
Executable → Regular
+10
-10
@@ -8,17 +8,17 @@
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace DBConnection
|
||||
{
|
||||
NGLDB_EXPORT QSqlDatabase open(NGL::INGLLogger &logger,
|
||||
const QString &dbUser,
|
||||
const QString &dbPasswd,
|
||||
const QString &dbDriver,
|
||||
const QString &dbHost,
|
||||
const QString &dbName,
|
||||
const QString &schemaName = QString(),
|
||||
const QString &connectionName = QString());
|
||||
}
|
||||
NGLDB_EXPORT QSqlDatabase open(NGL::INGLLogger &logger,
|
||||
const QString &dbUser,
|
||||
const QString &dbPasswd,
|
||||
const QString &dbDriver,
|
||||
const QString &dbHost,
|
||||
const QString &dbName,
|
||||
const QString &schemaName = QString(),
|
||||
const QString &connectionName = QString());
|
||||
}
|
||||
Executable → Regular
+3
-3
@@ -8,9 +8,9 @@
|
||||
thread_local int s_refCounter = 0;
|
||||
|
||||
DBTransaction::DBTransaction(const QSqlDatabase &db)
|
||||
: m_db(db)
|
||||
, m_bCommitted(true)
|
||||
, mLogger(NGLDB::getLogger("DBTransaction"))
|
||||
: m_db(db)
|
||||
, m_bCommitted(true)
|
||||
, mLogger(NGLDB::getLogger("DBTransaction"))
|
||||
{
|
||||
++s_refCounter;
|
||||
if (s_refCounter == 1)
|
||||
|
||||
Executable → Regular
+4
-10
@@ -8,31 +8,27 @@
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
|
||||
class NGLDB_EXPORT DBTransaction
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
explicit DBTransaction(const QSqlDatabase &db);
|
||||
|
||||
|
||||
|
||||
~DBTransaction();
|
||||
|
||||
|
||||
|
||||
bool begin();
|
||||
|
||||
|
||||
|
||||
bool commit();
|
||||
|
||||
|
||||
|
||||
bool rollback();
|
||||
|
||||
|
||||
|
||||
bool state() const;
|
||||
|
||||
@@ -44,5 +40,3 @@ private:
|
||||
bool m_lastState;
|
||||
NGL::INGLLogger &mLogger;
|
||||
};
|
||||
|
||||
|
||||
Executable → Regular
+9
-9
@@ -5,13 +5,13 @@
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef NGLDB_EXPORT
|
||||
# ifdef BUILD_STATIC_LIBRARIES
|
||||
# define NGLDB_EXPORT
|
||||
# else
|
||||
# if defined(MAKE_NGLDB_LIB)
|
||||
# define NGLDB_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define NGLDB_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# endif
|
||||
#ifdef BUILD_STATIC_LIBRARIES
|
||||
#define NGLDB_EXPORT
|
||||
#else
|
||||
#if defined(MAKE_NGLDB_LIB)
|
||||
#define NGLDB_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
#define NGLDB_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
Executable → Regular
+5
-4
@@ -13,10 +13,11 @@ NGLDB::LOGGER_T NGLDB::getLogger(const char *name)
|
||||
loggerName.append(ns, sizeof(ns) - 1);
|
||||
loggerName.append(name, len);
|
||||
|
||||
try {
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
|
||||
getNGLLogger( loggerName );
|
||||
} catch ( const std::exception &ex )
|
||||
try
|
||||
{
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(loggerName);
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
fprintf(stderr, "Error retrieving logger: %s", ex.what());
|
||||
abort();
|
||||
|
||||
Executable → Regular
+8
-8
@@ -12,8 +12,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef NGLDB_ENABLE_TRACE
|
||||
#define DB_TRACE { TRACE_LOG(mLogger) << DB_TRACE_FUNCTION }
|
||||
#define DB_TRACE2(x) { TRACE_LOG(mLogger) << DB_TRACE_FUNCTION << x }
|
||||
#define DB_TRACE {TRACE_LOG(mLogger) << DB_TRACE_FUNCTION}
|
||||
#define DB_TRACE2(x) {TRACE_LOG(mLogger) << DB_TRACE_FUNCTION << x}
|
||||
#else
|
||||
#define DB_TRACE
|
||||
#define DB_TRACE2(x)
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
namespace NGLDB
|
||||
{
|
||||
typedef NGL::INGLLogger &LOGGER_T;
|
||||
typedef NGL::INGLLogger &LOGGER_T;
|
||||
|
||||
LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable → Regular
+20
-22
@@ -20,42 +20,40 @@
|
||||
|
||||
static QString getSqlErrorString(const QSqlError &error)
|
||||
{
|
||||
return error.driverText() + QLatin1Char(' ') +
|
||||
error.databaseText() + QLatin1Char(' ') +
|
||||
error.nativeErrorCode();
|
||||
return error.driverText() + QLatin1Char(' ') + error.databaseText() + QLatin1Char(' ') + error.nativeErrorCode();
|
||||
}
|
||||
|
||||
NSqlQuery::NSqlQuery(const QSqlDatabase &db)
|
||||
: QSqlQuery(db)
|
||||
, m_db(db)
|
||||
, mLogger(NGLDB::getLogger("NSqlQuery"))
|
||||
: QSqlQuery(db)
|
||||
, m_db(db)
|
||||
, mLogger(NGLDB::getLogger("NSqlQuery"))
|
||||
{
|
||||
DB_TRACE
|
||||
setForwardOnly(true);
|
||||
}
|
||||
|
||||
NSqlQuery::NSqlQuery(const QSqlDatabase &db, NGL::INGLLogger &logger)
|
||||
: QSqlQuery(db)
|
||||
, m_db(db)
|
||||
, mLogger(logger)
|
||||
: QSqlQuery(db)
|
||||
, m_db(db)
|
||||
, mLogger(logger)
|
||||
{
|
||||
DB_TRACE
|
||||
setForwardOnly(true);
|
||||
}
|
||||
|
||||
NSqlQuery::NSqlQuery(const QString &query, const QSqlDatabase &db)
|
||||
: QSqlQuery(query, db)
|
||||
, m_db(db)
|
||||
, mLogger(NGLDB::getLogger("NSqlQuery"))
|
||||
: QSqlQuery(query, db)
|
||||
, m_db(db)
|
||||
, mLogger(NGLDB::getLogger("NSqlQuery"))
|
||||
{
|
||||
DB_TRACE
|
||||
setForwardOnly(true);
|
||||
}
|
||||
|
||||
NSqlQuery::NSqlQuery(const QString &query, const QSqlDatabase &db, NGL::INGLLogger &logger)
|
||||
: QSqlQuery(query, db)
|
||||
, m_db(db)
|
||||
, mLogger(logger)
|
||||
: QSqlQuery(query, db)
|
||||
, m_db(db)
|
||||
, mLogger(logger)
|
||||
{
|
||||
DB_TRACE
|
||||
setForwardOnly(true);
|
||||
@@ -143,12 +141,12 @@ bool NSqlQuery::exec(bool bEmitMessageOnError)
|
||||
if (mLogger.isDebugEnabled())
|
||||
{
|
||||
const QMap<QString, QVariant> &boundValuesMap = boundValues();
|
||||
for (auto it=boundValuesMap.begin(); it != boundValuesMap.end(); ++it)
|
||||
for (auto it = boundValuesMap.begin(); it != boundValuesMap.end(); ++it)
|
||||
{
|
||||
if ( it.value().canConvert<QString>())
|
||||
DEBUG_LOG(mLogger) << "key='" << it.key() << "' value='" << it.value().toString() << "'";
|
||||
if (it.value().canConvert<QString>())
|
||||
DEBUG_LOG(mLogger) << "key='" << it.key() << "' value='" << it.value().toString() << "'";
|
||||
else
|
||||
DEBUG_LOG(mLogger) << "key='" << it.key() << "' value cant Convert to string'";
|
||||
DEBUG_LOG(mLogger) << "key='" << it.key() << "' value cant Convert to string'";
|
||||
}
|
||||
}
|
||||
if (QSqlQuery::exec())
|
||||
@@ -257,7 +255,7 @@ QString NSqlQuery::sqlstate()
|
||||
#ifdef PostgreSQL_FOUND
|
||||
if (resultHandle.isValid() && (qstrcmp(resultHandle.typeName(), "PGresult*") == 0))
|
||||
{
|
||||
const PGresult *pgresHandle = *static_cast<const PGresult * const *>(resultHandle.data());
|
||||
const PGresult *pgresHandle = *static_cast<const PGresult *const *>(resultHandle.data());
|
||||
|
||||
if (pgresHandle != nullptr)
|
||||
{
|
||||
@@ -265,7 +263,7 @@ QString NSqlQuery::sqlstate()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return QStringLiteral("58000");
|
||||
}
|
||||
|
||||
@@ -383,7 +381,7 @@ QVariant NSqlQuery::value(int index) const
|
||||
return QSqlQuery::value(index);
|
||||
}
|
||||
|
||||
NSqlQuery &NSqlQuery::operator= (const NSqlQuery &other)
|
||||
NSqlQuery &NSqlQuery::operator=(const NSqlQuery &other)
|
||||
{
|
||||
DB_TRACE
|
||||
// Use move assignment to avoid deprecated copy-assignment of QSqlQuery.
|
||||
|
||||
Executable → Regular
+6
-51
@@ -10,205 +10,160 @@
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
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);
|
||||
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; }
|
||||
|
||||
Executable → Regular
+2
-2
@@ -7,14 +7,14 @@
|
||||
|
||||
|
||||
SqlQueryJanitor::SqlQueryJanitor(NSqlQuery *query)
|
||||
: m_query(query)
|
||||
: m_query(query)
|
||||
{
|
||||
Q_ASSERT(m_query);
|
||||
Q_ASSERT(!m_query->isActive());
|
||||
}
|
||||
|
||||
SqlQueryJanitor::SqlQueryJanitor(const std::unique_ptr<NSqlQuery> &query)
|
||||
: SqlQueryJanitor(query.get())
|
||||
: SqlQueryJanitor(query.get())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
+1
-2
@@ -9,7 +9,6 @@
|
||||
class NSqlQuery;
|
||||
|
||||
|
||||
|
||||
class NGLDB_EXPORT SqlQueryJanitor
|
||||
{
|
||||
public:
|
||||
@@ -18,5 +17,5 @@ public:
|
||||
~SqlQueryJanitor();
|
||||
|
||||
private:
|
||||
NSqlQuery *m_query;
|
||||
NSqlQuery *m_query;
|
||||
};
|
||||
Reference in new issue
Block a user