minor bug fix [skip ci]
This commit is contained in:
parent
6254c11267
commit
a199d91135
|
|
@ -170,7 +170,7 @@ QString PostgreSqlGenerator::fieldType(FieldModel *field)
|
|||
case QMetaType::QJsonValue:
|
||||
case QMetaType::QJsonObject:
|
||||
case QMetaType::QJsonDocument:
|
||||
return "JSON";
|
||||
return "JSONB";
|
||||
|
||||
case QMetaType::QStringList:
|
||||
return "TEXT[]";
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@ protected:
|
|||
QString agregateText(const AgregateType &t, const QString &arg = QString()) const;
|
||||
QString fromTableText(const QString &tableName, QString &joinClassName, QString &orderBy) const;
|
||||
// QString createWhere(QList<WherePhrase> &wheres);
|
||||
|
||||
void replaceTableNames(QString &command);
|
||||
void removeTableNames(QString &command);
|
||||
};
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -186,11 +186,4 @@ void SqlServerGenerator::appendSkipTake(QString &sql, int skip, int take)
|
|||
.arg(skip).arg(take));
|
||||
}
|
||||
|
||||
void SqlServerGenerator::replaceTableNames(QString &command)
|
||||
{
|
||||
foreach (TableModel *m, TableModel::allModels())
|
||||
command = command
|
||||
.replace("[" + m->className() + "]", m->name() );
|
||||
}
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Q_OUTOFLINE_TEMPLATE RowList<T> Query<T>::toList(int count)
|
|||
d->sql = d->database->sqlGenertor()->selectCommand(
|
||||
d->tableName, d->fieldPhrase, d->wherePhrase, d->orderPhrase,
|
||||
d->relations, d->skip, d->take);
|
||||
qDebug()<<d->sql;
|
||||
|
||||
QSqlQuery q = d->database->exec(d->sql);
|
||||
if (q.lastError().isValid()) {
|
||||
qDebug() << q.lastError().text();
|
||||
|
|
|
|||
Loading…
Reference in New Issue