berlindb / core

All of the required core code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue chaining normal query after a query with `fields`

CrochetFeve0251 opened this issue · comments

When we are running a query with fields params it triggers that line that change the shape to stdClass which is totally fine for that context.

However the shape is never reverted and so when we run a normal query afterwise then the shape is still stdClass which give inconsistent output as it is not using the defined Row class anymore.

A potential solution would be to create a new property query_item_shape that will be the shape for the current query and which is redefined at each query to prevent border effect from one query to another.

@JJJ maybe this is related to the core of #160 -- using a new instance of the query class each time?

Good call @spencerfinnell! Thank you @CrochetFeve0251! I merged your fix as-is, and really appreciate your contribution(s)! 🙌🙌🙌