You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Problem
If JSON type is applied to a column label but the value is a Medoo::raw statement, the value resolves to a string, not a JSON object.
Detail Code
In some circumstances, it is useful to generate a JSON from the result of a Medoo::raw statement. One such example is where one is performing a 1:many join, and one wishes to build a JSON object by using GROUP_CONCAT. An example is as follows:
Information
Describe the Problem
If JSON type is applied to a column label but the value is a
Medoo::raw
statement, the value resolves to a string, not a JSON object.Detail Code
In some circumstances, it is useful to generate a JSON from the result of a Medoo::raw statement. One such example is where one is performing a 1:many join, and one wishes to build a JSON object by using GROUP_CONCAT. An example is as follows:
In line 1349 of
Medoo.php
, thepreg_match
for column keys doesn't matchObject
orJSON
types.So the above mapping ends up producing a String in Medoo's result.
I am not sure if the
Object
andJSON
type keywords are missing from the pattern intentionally or accidentally.Expected output
A column with the type set to JSON and a value that is a
Medoo::raw
statement should return JSON, not a string.The text was updated successfully, but these errors were encountered: