Why doesn't Moqui support the JSON datatype in MySQL or any other datasources?

Hi everyone,

I’ve been working with Moqui and MySQL, and I wanted to leverage MySQL’s JSON datatype to handle flexible, dynamic data more efficiently. However, Moqui doesn’t seem to support this data type. MySQL offers powerful JSON functions like JSON_EXTRACT() and JSON_ARRAYAGG(), which could be useful in my project.

I’m curious to know why Moqui doesn’t have built-in support for the JSON datatype in MySQL. Are there any technical reasons or design considerations that prevent it?

What If I will add the support for JSON type, and use it in my project?

Thanks!
Purushottam Khedre

So I would guess the easiest way to do this is by adding a new <dictionary-type .../> in MoquiDefaultConf.xml (or your own conf) for the JSON structure and map it to all databases that support JSON, and some modification to DB facade is needed. If I’m not mistaken I think only newer versions of MySQL, Postgres and Oracle support this, which means we would implement a feature not supported by all databases. So the abstraction layer would be broken because it doesn’t cover all the databases.

To me I prefer database independence, and utilizing database-specific features might compromise that. I could be mistaken of course but these are my first impression thoughts/

4 Likes