Skip to content

Commit 029a502

Browse files
committed
debugging function to add sql query to Toc sheet
1 parent 3b1c236 commit 029a502

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/excel-generator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ExcelGenerator {
3333

3434
// 목차 시트를 맨 처음에 생성 (내용은 나중에 채움)
3535
let tocSheet = null;
36-
36+
3737
for (const sheetDef of sheets) {
3838
// robust use 속성 체크
3939
if (!this.isSheetEnabled(sheetDef)) {
@@ -141,12 +141,12 @@ class ExcelGenerator {
141141
tocOnly.addRow(['No', 'Sheet Name', 'Data Count', 'Query']);
142142

143143
createdSheetNames.forEach((obj, idx) => {
144-
// 쿼리문 정보 추출 (최대 80자로 제한)
144+
// 쿼리문 정보 추출 (최대 10000자로 제한)
145145
let queryText = '';
146146
if (obj.query) {
147147
queryText = obj.query.replace(/\s+/g, ' ').trim(); // 연속 공백 제거
148-
if (queryText.length > 80) {
149-
queryText = queryText.substring(0, 77) + '...';
148+
if (queryText.length > 10000) {
149+
queryText = queryText.substring(0, 10000) + '... 이하 생략 (최대 10000자로 제한) .....';
150150
}
151151
}
152152

src/excel-style-helper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,12 @@ function populateTableOfContents(tocSheet, sheetNames) {
418418
}
419419
aggregateInfo = `관련데이터 ${obj.recordCount}${aggregateInfo}`
420420

421-
// 쿼리문 정보 추출 (최대 100자로 제한)
421+
// 쿼리문 정보 추출 (최대 10000자로 제한)
422422
let queryText = '';
423423
if (obj.query) {
424424
queryText = obj.query.replace(/\s+/g, ' ').trim(); // 연속 공백 제거
425-
if (queryText.length > 100) {
426-
queryText = queryText.substring(0, 97) + '...';
425+
if (queryText.length > 10000) {
426+
queryText = queryText.substring(0, 10000) + '... 이하 생략 (최대 10000자로 제한) .....';
427427
}
428428
}
429429

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ async function main() {
240240
style: sheetStyle,
241241
recordCount: recordCount,
242242
dbKey: sheetDbKey,
243-
aggregateColumn: sheetDef.aggregateColumn
243+
aggregateColumn: sheetDef.aggregateColumn,
244+
query: sql
244245
});
245246

246247
console.log(`\t---> ${recordCount} rows were selected `);

0 commit comments

Comments
 (0)