better type habndling, shell-tableReader for preserving table structure

This commit is contained in:
Jan Prochazka
2020-06-18 21:50:37 +02:00
parent cecb88f024
commit bfc6f2a8a8
13 changed files with 52 additions and 16 deletions

View File

@@ -85,7 +85,7 @@ const driver = {
return query;
},
async readQuery(connection, sql) {
async readQuery(connection, sql, structure) {
const query = connection.query(sql);
const { stream } = connection._nativeModules;
@@ -99,7 +99,7 @@ const driver = {
console.error(err);
pass.end();
})
.on('fields', (fields) => pass.write({ columns: extractColumns(fields) }))
.on('fields', (fields) => pass.write(structure || { columns: extractColumns(fields) }))
.on('result', (row) => pass.write(row))
.on('end', () => pass.end());