Skip to content

New as array/object option breaks Typescript #71

@isaac-mcfadyen

Description

@isaac-mcfadyen

Hi! 👋

I updated my Planetscale driver version today and Typescript started generating errors.

After a bit of investigation, it seems that Typescript is seeing that a row can now be an Array or an Object and defaulting to Array (so things like query.rows[0].row_name break, even when specifying as).

It seems to be this line. A row can either be an array or an object and array is preferred so it's underlined red.

type Row = Record<string, any> | any[]

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