mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 14:30:39 +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 ) {
|
||||
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;
|
||||
emit sqlError(query);
|
||||
log(msg);
|
||||
@ -173,8 +173,9 @@ QString DatabaseManager::getLastQuery(const QSqlQuery& query) const
|
||||
|
||||
void DatabaseManager::log(const QString &msg) const
|
||||
{
|
||||
qDebug() << "database logger implement logger";
|
||||
qDebug() << msg;
|
||||
//TODO: database logs
|
||||
// qDebug() << "database logger implement logger";
|
||||
//qDebug() << msg;
|
||||
}
|
||||
|
||||
bool DatabaseManager::dryMode() const
|
||||
|
||||
@ -148,15 +148,16 @@ QSqlQuery DatabaseUtils::insertIntoTable(const DatabaseTable *table, const QStri
|
||||
for (const auto& _key : keys ) {
|
||||
QString key = fromCamelCase(_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 {
|
||||
// if (value.type() == QVariant::Type::String) {
|
||||
// QString temp = "'" + value.toString() + "'";
|
||||
// query.bindValue(":" + key, temp);
|
||||
// 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||
@ -194,15 +195,9 @@ QSqlQuery DatabaseUtils::updateTable(const DatabaseTable *table, const QString &
|
||||
for (const auto& _key : keys ) {
|
||||
QString key = fromCamelCase(_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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user