mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 16:13:58 +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;
|
modifyDate?: string;
|
||||||
hashCode?: string;
|
hashCode?: string;
|
||||||
objectTypeField?: string;
|
objectTypeField?: string;
|
||||||
obejctComment?: string;
|
objectComment?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SqlObjectInfo extends DatabaseObjectInfo {
|
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>
|
</script>
|
||||||
|
|
||||||
<AppObjectCore
|
<AppObjectCore
|
||||||
|
|||||||
@@ -932,6 +932,9 @@
|
|||||||
|
|
||||||
function getExtInfo(data) {
|
function getExtInfo(data) {
|
||||||
const res = [];
|
const res = [];
|
||||||
|
if (data.objectComment) {
|
||||||
|
res.push(data.objectComment);
|
||||||
|
}
|
||||||
if (data.tableRowCount != null) {
|
if (data.tableRowCount != null) {
|
||||||
res.push(`${formatRowCount(data.tableRowCount)} rows`);
|
res.push(`${formatRowCount(data.tableRowCount)} rows`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user