From ff6f568b3403715c7ca63912361678064b642b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= Date: Fri, 22 Aug 2025 13:48:33 +0200 Subject: [PATCH] Use plain console.dir for list output --- src/index.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8e9ed29..1c8540a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -245,16 +245,20 @@ async function main() { }) if (table) { - console.table( - table.columns.map((col) => ({ - name: col.name, - type: col.datatype, - flags: [col.identity ? 'ID' : '', col.nullable ? '' : 'NOT NULL'] - .filter(Boolean) - .join(' '), - default: col.default, - })), - ) + const rows = table.columns.map((col) => ({ + name: col.name, + type: col.datatype, + flags: [col.identity ? 'ID' : '', col.nullable ? '' : 'NOT NULL'] + .filter(Boolean) + .join(' '), + default: col.default, + })) + + if (displayMode === 'table') { + console.table(rows) + } else { + console.dir(rows, { depth: null }) + } } else { console.log('Did not find', name) } @@ -265,10 +269,7 @@ async function main() { if (displayMode === 'table') { console.table(result.rows) } else { - result.rows.forEach((row, idx) => { - console.log(`=== row ${idx} ========================`) - console.log(row) - }) + console.dir(result.rows, { depth: null }) } } else if (result.rowsAffected !== undefined) { console.log(`${result.rowsAffected} rows affected`)