db
db copied to clipboard
Lazy parsing for `array`, `structured` and `json` types
Suggested to store in ArrayExpression, StructuredExpression and JsonExpression the string value retrieved from the database and convert it to an array or other PHP representation as the data is accessed.
This will save resources if the data is not used during execution.
Can be optionally.
Sounds good from a performance perspective. The only thing is that checks such as is_array would become instanceof ArrayResult or something alike.
Actually I think about ArrayExpression which already realizes ArrayAccess, Countable and IteratorAggregate interfaces and the check should be is_iterable().
Expression is logically an input. Not sure it is a good idea to reuse for results.