mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 19:10:49 +02:00
Add update auth token
This commit is contained in:
parent
403c2e4a2d
commit
fcf43b043e
@ -151,7 +151,7 @@ QSqlQuery DatabaseManager::processResult(int res, const QSqlQuery &query) const
|
|||||||
{
|
{
|
||||||
if ( !res ) {
|
if ( !res ) {
|
||||||
QString msg = QString("Source: Database Manager \nError --------\n%1\nSQL-------\n%2\n--------")
|
QString msg = QString("Source: Database Manager \nError --------\n%1\nSQL-------\n%2\n--------")
|
||||||
.arg(query.lastError().text(), query.lastQuery());
|
.arg(query.lastError().text(), getLastQuery(query));
|
||||||
qCDebug(sdkdb).noquote() << msg;
|
qCDebug(sdkdb).noquote() << msg;
|
||||||
emit sqlError(query);
|
emit sqlError(query);
|
||||||
log(msg);
|
log(msg);
|
||||||
@ -173,8 +173,9 @@ QString DatabaseManager::getLastQuery(const QSqlQuery& query) const
|
|||||||
|
|
||||||
void DatabaseManager::log(const QString &msg) const
|
void DatabaseManager::log(const QString &msg) const
|
||||||
{
|
{
|
||||||
qDebug() << "database logger implement logger";
|
//TODO: database logs
|
||||||
qDebug() << msg;
|
// qDebug() << "database logger implement logger";
|
||||||
|
//qDebug() << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseManager::dryMode() const
|
bool DatabaseManager::dryMode() const
|
||||||
|
|||||||
@ -148,15 +148,16 @@ QSqlQuery DatabaseUtils::insertIntoTable(const DatabaseTable *table, const QStri
|
|||||||
for (const auto& _key : keys ) {
|
for (const auto& _key : keys ) {
|
||||||
QString key = fromCamelCase(_key);
|
QString key = fromCamelCase(_key);
|
||||||
auto value = valueMap.value(_key);
|
auto value = valueMap.value(_key);
|
||||||
if (value.type() == QVariant::Type::String) {
|
// if (value.type() == QVariant::Type::String) {
|
||||||
QString temp = "'" + value.toString() + "'";
|
// QString temp = "'" + value.toString() + "'";
|
||||||
query.bindValue(":" + key, temp);
|
// query.bindValue(":" + key, temp);
|
||||||
} else if (value.type() == QVariant::Type::DateTime) {
|
// if (value.type() == QVariant::Type::DateTime) {
|
||||||
QString temp = "'" + value.toDateTime().toString("yyyy-MM-dd hh:mm:ss") + "'";
|
// QString temp = "'" + value.toDateTime().toString("yyyy-MM-dd hh:mm:ss") + "'";
|
||||||
query.bindValue(":" + key, temp);
|
// query.bindValue(":" + key, temp);
|
||||||
} else {
|
// } else
|
||||||
|
|
||||||
query.bindValue(":" + key, value);
|
query.bindValue(":" + key, value);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||||
@ -194,15 +195,9 @@ QSqlQuery DatabaseUtils::updateTable(const DatabaseTable *table, const QString &
|
|||||||
for (const auto& _key : keys ) {
|
for (const auto& _key : keys ) {
|
||||||
QString key = fromCamelCase(_key);
|
QString key = fromCamelCase(_key);
|
||||||
auto value = valueMap.value(_key);
|
auto value = valueMap.value(_key);
|
||||||
if (value.type() == QVariant::Type::String) {
|
|
||||||
QString temp = "'" + value.toString() + "'";
|
|
||||||
query.bindValue(":" + key, temp);
|
|
||||||
} else if (value.type() == QVariant::Type::DateTime) {
|
|
||||||
QString temp = "'" + value.toDateTime().toString("yyyy-MM-dd hh:mm:ss") + "'";
|
|
||||||
query.bindValue(":" + key, temp);
|
|
||||||
} else {
|
|
||||||
query.bindValue(":" + key, value);
|
query.bindValue(":" + key, value);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user