Fix Statistics: task statistics empty on MikroORM with MySQL or SQLite

Merged
ND
4d ago
+25-2

Fixes #11214

On MikroORM, task statistics read .rows from the raw knex result, which only PostgreSQL returns, so MySQL and SQLite always got an empty list. The rows are now read from the shape each driver returns: [rows, fields] on MySQL and the row array on SQLite. The query, the PostgreSQL result and the TypeORM branch stay as they were.


Summary by cubic

Fixes #11214: MikroORM task statistics returned an empty list on MySQL and SQLite because the raw knex result was read via .rows, which only the PostgreSQL driver provides. Rows are now read from each driver's result shape.

  • MySQL returns [rows, fields]; SQLite returns the rows array.
  • The PostgreSQL result and the TypeORM branch stay unchanged.