berlindb / core

All of the required core code
MIT License
252 stars 27 forks source link

Issue chaining normal query after a query with `fields` #162

Closed CrochetFeve0251 closed 8 months ago

CrochetFeve0251 commented 8 months ago

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.

spencerfinnell commented 8 months ago

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

JJJ commented 8 months ago

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