Skip to content

Ability to pass in types to .query() #144

@BlackAsLight

Description

@BlackAsLight

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 }[]>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions