Skip to content

Latest Sqljs@1.2.1 throws an error when querying #5720

@atifsyedali

Description

@atifsyedali

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[x] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:
Trying to query using the latest Sqljs and TypeORM throws an error: QueryFailedError: TypeError: Cannot convert undefined or null to object.

It turns out that when we have parameters in SqljsQueryRunner#query is undefined/null, the latest sqljs throws an error.

Harmless fix is to either skip the bind or give default value for parameters as an empty array within the SqljsQueryRunner only.

Tested in browser main thread, as well as worker thread. Both works.

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