mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.22k stars 2.53k forks source link

Convert Field columnType to human readable format #2504

Closed usersina closed 3 years ago

usersina commented 3 years ago

I have a simple use case where I want to display the types of the fields:

let [rows, fields] = await conn.execute("SELECT * FROM users");
var typesArray = fields.map((field) => {
    return field['columnType'];
  });

However the output is:

[3, 252, 252]

I want to ultimately get ['int', 'string', 'string'] or something similar.

dougwilson commented 3 years ago

Hi @UserSina you may have opened this in the wrong repository. This module does not support the await syntax, does not have an .execute method, and does not have a columnType property on the field objects.