berlindb / core

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

Issue/113 - Query: audit shape_item_id() usages. #117

Closed JJJ closed 2 years ago

JJJ commented 2 years ago

This commit adds a third parameter to transition_item() for the item ID to be passed directly into it rather than derived from the old data.

Previously, it was possible that the old data would be of a mixed type, potentially an integer in the case of a newly added item. This was weird and confusing. Now old data will just be an empty array (because there is no old data) and the third parameter will include the item ID which is known from the previous MySQL query result.

Additionally, this commit updates a bunch of inline docs relative to when shape_item_id() is called to make everything consistent where it makes sense.

Fixes #113.