Use plain console.dir for list output
This commit is contained in:
parent
04db6ffcb4
commit
ff6f568b34
1 changed files with 15 additions and 14 deletions
29
src/index.ts
29
src/index.ts
|
@ -245,16 +245,20 @@ async function main() {
|
||||||
})
|
})
|
||||||
|
|
||||||
if (table) {
|
if (table) {
|
||||||
console.table(
|
const rows = table.columns.map((col) => ({
|
||||||
table.columns.map((col) => ({
|
name: col.name,
|
||||||
name: col.name,
|
type: col.datatype,
|
||||||
type: col.datatype,
|
flags: [col.identity ? 'ID' : '', col.nullable ? '' : 'NOT NULL']
|
||||||
flags: [col.identity ? 'ID' : '', col.nullable ? '' : 'NOT NULL']
|
.filter(Boolean)
|
||||||
.filter(Boolean)
|
.join(' '),
|
||||||
.join(' '),
|
default: col.default,
|
||||||
default: col.default,
|
}))
|
||||||
})),
|
|
||||||
)
|
if (displayMode === 'table') {
|
||||||
|
console.table(rows)
|
||||||
|
} else {
|
||||||
|
console.dir(rows, { depth: null })
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Did not find', name)
|
console.log('Did not find', name)
|
||||||
}
|
}
|
||||||
|
@ -265,10 +269,7 @@ async function main() {
|
||||||
if (displayMode === 'table') {
|
if (displayMode === 'table') {
|
||||||
console.table(result.rows)
|
console.table(result.rows)
|
||||||
} else {
|
} else {
|
||||||
result.rows.forEach((row, idx) => {
|
console.dir(result.rows, { depth: null })
|
||||||
console.log(`=== row ${idx} ========================`)
|
|
||||||
console.log(row)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} else if (result.rowsAffected !== undefined) {
|
} else if (result.rowsAffected !== undefined) {
|
||||||
console.log(`${result.rowsAffected} rows affected`)
|
console.log(`${result.rowsAffected} rows affected`)
|
||||||
|
|
Loading…
Reference in a new issue