Use plain console.dir for list output

This commit is contained in:
Jan Hamal Dvořák 2025-08-22 13:48:33 +02:00
parent 04db6ffcb4
commit ff6f568b34
Signed by: mordae
GPG key ID: 1782BCC23EE007B9

View file

@ -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`)