How to export a mysql SELECT to JSON, not as escaped text?

Viewed 525

After trying different things for hours now it's starting to drive me nuts. So I really hope somebody here could help me with this.

I have a test select query which has only one field that is the result of JSON_OBJECT() function, so that should be JSON (no text). But whatever I try, phpMyAdmin keeps escaping the json keys on an export of the result grid. Which is obviously not what I want when exporting to JSON.

Just a simple example, this: SELECT JSON_OBJECT("key", "value") as json, results into this: screenshot and exports to something like this:

{
    "json": "{\"key\": \"value\"}"
}

Which is obviously no valid json as key should be a key, not part of a string.

Is there somebody out there that could please tell me how to export json data as real json without acting like the output of JSON_OBJECT() is text, so without the wrong escapes?

Thanks in advance!!

Using: - MariaDb 10.4.10 - phpMyAdmin 4.9.2

0 Answers
Related