JSON functions were added in MariaDB 10.2.3.
JSON_QUOTE(json_value)
Quotes a string as a JSON value, usually for producing valid JSON string literals for inclusion in JSON documents. Wraps the string with double quote characters and escapes interior quotes and other special characters, returning a utf8mb4 string.
Returns NULL if the argument is NULL.
SELECT JSON_QUOTE('A'), JSON_QUOTE("B"), JSON_QUOTE('"C"'); +-----------------+-----------------+-------------------+ | JSON_QUOTE('A') | JSON_QUOTE("B") | JSON_QUOTE('"C"') | +-----------------+-----------------+-------------------+ | "A" | "B" | "\"C\"" | +-----------------+-----------------+-------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/json_quote/