Skip to content

[Feature] A type can be defined for rows in the query result #150

@yutak23

Description

@yutak23

With the current type definition, the result of the following query got.rows[0] would be any.

const got = await connection.execute('SELECT 1, null from dual;'); const row = got.rows[0]; // typeof row is any 

Therefore, we do not get the benefit of this when developing in TypeScript (properties are not suggested, accessing a property that does not exist, and it becomes undefined).

I think it would be better if we could define a type for row as follows

image

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