Skip to content

Commit 1b6bf65

Browse files
committed
Merge branch 'main' into feature/column_label_preview
# Conflicts: # src/views/results/html.ts
2 parents 25660c1 + 622975b commit 1b6bf65

File tree

2 files changed

+37
-28
lines changed

2 files changed

+37
-28
lines changed

src/connection/manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class SQLJobManager {
3535
"full open": false,
3636
"transaction isolation": "none",
3737
"query optimize goal": "1",
38-
"block size": "512"
38+
"block size": "512",
39+
"extended metadata": true
3940
}));
4041

4142
try {

src/views/results/html.ts

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -434,33 +434,7 @@ export function generateScroller(basicSelect: string, isCL: boolean, withCancel?
434434
columnMetaData.map(column => {
435435
var cell = headerRow.insertCell();
436436
cell.appendChild(document.createTextNode(columnHeadings === 'Label' ? column.label : column.name));
437-
switch (column.type) {
438-
case 'CHAR':
439-
case 'VARCHAR':
440-
case 'CLOB':
441-
case 'BINARY':
442-
case 'VARBINARY':
443-
case 'BLOB':
444-
case 'GRAPHIC':
445-
case 'VARGRAPHIC':
446-
case 'DBCLOB':
447-
case 'NCHAR':
448-
case 'NVARCHAR':
449-
case 'NCLOB':
450-
case 'FLOAT':
451-
case 'DECFLOAT':
452-
case 'DATALINK':
453-
cell.title = column.type + '(' + column.precision + ')';
454-
break;
455-
case 'DECIMAL':
456-
case 'NUMERIC':
457-
cell.title = column.type + '(' + column.precision + ', ' + column.scale + ')';
458-
break;
459-
default:
460-
cell.title = column.type;
461-
}
462-
cell.title += '\n' + columnHeadings === 'Label' ? column.name : column.label;
463-
return cell;
437+
cell.title = getTooltip(column, columnHeadings);
464438
});
465439
466440
// Initialize the footer
@@ -539,9 +513,43 @@ export function generateScroller(basicSelect: string, isCL: boolean, withCancel?
539513
var headerCells = document.getElementById(htmlTableId).getElementsByTagName('thead')[0].rows[0].cells;
540514
for (let x = 0; x < headerCells.length; ++x) {
541515
headerCells[x].innerText = columnHeadings === 'Label' ? columnMetaData[x].label : columnMetaData[x].name;
516+
headerCells[x].title = getTooltip(columnMetaData[x], columnHeadings);
542517
}
543518
}
544519
}
520+
521+
function getTooltip(column, columnHeadings) {
522+
let title = '';
523+
switch (column.type) {
524+
case 'CHAR':
525+
case 'VARCHAR':
526+
case 'CLOB':
527+
case 'BINARY':
528+
case 'VARBINARY':
529+
case 'BLOB':
530+
case 'GRAPHIC':
531+
case 'VARGRAPHIC':
532+
case 'DBCLOB':
533+
case 'NCHAR':
534+
case 'NVARCHAR':
535+
case 'NCLOB':
536+
case 'FLOAT':
537+
case 'DECFLOAT':
538+
case 'DATALINK':
539+
title = column.type + '(' + column.precision + ')';
540+
break;
541+
case 'DECIMAL':
542+
case 'NUMERIC':
543+
title = column.type + '(' + column.precision + ', ' + column.scale + ')';
544+
break;
545+
default:
546+
title = column.type;
547+
}
548+
title += \`\\n\`;
549+
title += columnHeadings === 'Label' ? column.name : column.label;
550+
return title;
551+
}
552+
545553
</script>
546554
</head>
547555
<body style="padding: 0;">

0 commit comments

Comments
 (0)