On the list of indexes of a table show which were created as part of the creation of a constraint
The explicit column is true when the index was manually created In SQL only a comment is given that the index was implicitly created
This commit is contained in:
parent
60bbb4c445
commit
fd5ad9bbf0
6 changed files with 56 additions and 20 deletions
|
|
@ -36,9 +36,16 @@ int IndexModel::columnCount(const QModelIndex &/*parent*/) const
|
|||
return colCount;
|
||||
}
|
||||
|
||||
Oid IndexModel::getType(int /*column*/) const
|
||||
Oid IndexModel::getType(int column) const
|
||||
{
|
||||
return Pgsql::varchar_oid;
|
||||
switch (column) {
|
||||
case SizeCol:
|
||||
return Pgsql::int8_oid;
|
||||
case ExplicitIndexCol:
|
||||
return Pgsql::bool_oid;
|
||||
default:
|
||||
return Pgsql::varchar_oid;
|
||||
}
|
||||
}
|
||||
|
||||
QVariant IndexModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
|
|
@ -66,6 +73,9 @@ QVariant IndexModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||
case SizeCol:
|
||||
c = tr("Size");
|
||||
break;
|
||||
case ExplicitIndexCol:
|
||||
c = tr("Explicit");
|
||||
break;
|
||||
// case DefinitionCol:
|
||||
// c = tr("Definition");
|
||||
// break;
|
||||
|
|
@ -106,6 +116,9 @@ QVariant IndexModel::getData(const QModelIndex &index) const
|
|||
case SizeCol:
|
||||
v = dat.sizeBytes;
|
||||
break;
|
||||
case ExplicitIndexCol:
|
||||
v = !dat.isSupportingIndex();
|
||||
break;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
ColumnsCol, ///
|
||||
ConditionCol,
|
||||
SizeCol,
|
||||
ExplicitIndexCol,
|
||||
colCount };
|
||||
|
||||
// oid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue