$ const [res, fields] = await conn.execute<RowDataPacket[]>(sql);
$ fields[0].type
undefined
$ console.log(fields[0])
{ catalog: 'def',
schema: 'companies',
name: 'created_at',
orgName: 'created_at',
table: 'companies',
orgTable: 'companies',
characterSet: 63,
columnLength: 19,
columnType: 12,
flags: 128,
decimals: 0 }
When fetching
FieldPackets from a query, I'm observing thatpacket.typeis undefined, in violation of its type: https://github.com/sidorares/node-mysql2/blob/master/typings/mysql/lib/protocol/packets/FieldPacket.d.ts#L18Example code:
In fact,
FieldPacketseems to have a significantly different structure than its type indicates.