mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 18:46:02 +00:00
Display comments into TABLES and COLUMNS lists #755
This commit is contained in:
2
packages/types/dbinfo.d.ts
vendored
2
packages/types/dbinfo.d.ts
vendored
@@ -75,7 +75,7 @@ export interface DatabaseObjectInfo extends NamedObjectInfo {
|
||||
modifyDate?: string;
|
||||
hashCode?: string;
|
||||
objectTypeField?: string;
|
||||
obejctComment?: string;
|
||||
objectComment?: string;
|
||||
}
|
||||
|
||||
export interface SqlObjectInfo extends DatabaseObjectInfo {
|
||||
|
||||
@@ -35,7 +35,21 @@
|
||||
];
|
||||
}
|
||||
|
||||
$: extInfo = data.foreignKey ? `${data.dataType} -> ${data.foreignKey.refTableName}` : data.dataType;
|
||||
function getExtInfo(data) {
|
||||
const res = [];
|
||||
if (data.foreignKey) {
|
||||
res.push(`${data.dataType} -> ${data.foreignKey.refTableName}`);
|
||||
} else {
|
||||
res.push(data.dataType);
|
||||
}
|
||||
if (data.columnComment) {
|
||||
res.push(data.columnComment);
|
||||
}
|
||||
if (res.length > 0) return res.join(', ');
|
||||
return null;
|
||||
}
|
||||
|
||||
$: extInfo = getExtInfo(data);
|
||||
</script>
|
||||
|
||||
<AppObjectCore
|
||||
|
||||
@@ -932,6 +932,9 @@
|
||||
|
||||
function getExtInfo(data) {
|
||||
const res = [];
|
||||
if (data.objectComment) {
|
||||
res.push(data.objectComment);
|
||||
}
|
||||
if (data.tableRowCount != null) {
|
||||
res.push(`${formatRowCount(data.tableRowCount)} rows`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user