Adds latest migration results
This commit is contained in:
829 files changed
+35074
-70886
No files matched your search
@@ -1,5 +1,8 @@
|
||||
# NGLDB
|
||||
FIND_PACKAGE(PostgreSQL REQUIRED)
|
||||
FIND_PACKAGE(PostgreSQL)
|
||||
IF(NOT PostgreSQL_FOUND)
|
||||
MESSAGE(WARNING "PostgreSQL not found - ngldb will be built without PostgreSQL support")
|
||||
ENDIF()
|
||||
|
||||
OPTION(ENABLE_DB_TRACING "Enable trace output for NGLDB library" OFF)
|
||||
IF(ENABLE_DB_TRACING)
|
||||
@@ -30,14 +33,21 @@ NGL_TARGET_LINK_LIBRARIES(ngldb
|
||||
PRIVATE
|
||||
NGLLogger
|
||||
nglsettings
|
||||
${PostgreSQL_LIBRARIES}
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
Qt6::Sql
|
||||
)
|
||||
IF(PostgreSQL_FOUND)
|
||||
NGL_TARGET_LINK_LIBRARIES(ngldb
|
||||
PRIVATE
|
||||
${PostgreSQL_LIBRARIES}
|
||||
)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(ngldb
|
||||
PRIVATE
|
||||
${PostgreSQL_INCLUDE_DIR}
|
||||
)
|
||||
ENDIF()
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(ngldb
|
||||
PRIVATE
|
||||
${PostgreSQL_INCLUDE_DIR}
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
)
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
#include <QtCore/QJsonValue>
|
||||
|
||||
#include "ngldb_logger.h"
|
||||
|
||||
#ifdef PostgreSQL_FOUND
|
||||
#include <libpq-fe.h>
|
||||
#endif
|
||||
|
||||
static QString getSqlErrorString(const QSqlError &error)
|
||||
{
|
||||
@@ -251,21 +254,17 @@ QString NSqlQuery::sqlstate()
|
||||
{
|
||||
const QVariant resultHandle = this->result()->handle();
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PostgreSQL_FOUND
|
||||
if (resultHandle.isValid() && (qstrcmp(resultHandle.typeName(), "PGresult*") == 0))
|
||||
{
|
||||
|
||||
const PGresult *pgresHandle = *static_cast<const PGresult * const *>(resultHandle.data());
|
||||
|
||||
if (pgresHandle != nullptr)
|
||||
{
|
||||
|
||||
return QString::fromLocal8Bit(PQresultErrorField(pgresHandle, PG_DIAG_SQLSTATE));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return QStringLiteral("58000");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user