mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Ability to pass in types to .query()

Open BlackAsLight opened this issue 2 years ago • 0 comments

At the moment it seems .query() returns type any, but it would be nice if I could pass in a generic to say what type will be returned from it.

mysql.query<{ id: number }[]>('SELECT id from aTable')
// Type: Promise<{ id: number }[]>

BlackAsLight avatar Dec 12 '22 03:12 BlackAsLight