Skip to content

DMLs are not returning an output while iterating the result using the conn.queryStream() iterator #293

Open
@ghost

Description

Hi all,

if I run an "UPDATE ..." query and I run it using the .queryStream method and I try to iterate the returned rows, the iterator doesn't return the result.

I'm using the for await (const elm of conn.queryStream()) { ... } syntax for this. Apparently, the code never enters the cycle and the execution goes ahead, meaning that the AsyncGenerator's Promise is indeed resolved as the query's execution ends.

While it does if the query is a DDL. I'm using .queryStream() over a connection borrowed from the connection pool, as the documentation suggests.

Instead, when I was using mysql2 in the past, I could get the same output that I can get using the mysql cli. Something like this:

Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

Can you help me to obtain the same behaviour on this connector?

Thank you

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