mysql_json
mysql_json copied to clipboard
add a function json_valid which returns true if the argument is valid json
I found that my queries were incomplete unless I could differentiate between an invalid object and an object that didn't have the property I was looking for.
The code could probably be simplified; I welcome any feedback you may have.
Sorry for not responding. It would be great if you could take the approach described below instead of copying the code.
- convert and rename
json_getto an internal function that returns both the result and error message -
json_getandjson_is_valid(personally I prefer functions returning booleans be prefixed with is) should be a wrapper function calling the internal function