4 ms·
> Though I was looking for a JSON data type earlier today and that didn't seem to be in there. Which JSON type are you missing? I store and query JSON extensi
by porker 5y ago
> Though I was looking for a JSON data type earlier today and that didn't seem to be in there.
Which JSON type are you missing? I store and query JSON extensively (probably too extensively) in MySQL and most things work great.
- linsomniac 5y agoThanks, I misunderstood the docs page for JSON, it says it is an alias for LONGTEXT, so I just used the latter, I didn't understand that it was doing more than just treating it as text. In my case I'm not expecting to do more with the JSON than treat it as a BLOB, so I didn't dig too far. I just changed my schema to JSON and I'm re-ingesting test data now.
- evanelias 5y agoAre you using MySQL or are you using MariaDB? They are distinct databases with different features. MySQL has had a full-featured native JSON column type since MySQL 5.7 (Oct 2015). Here's the current manual page for MySQL 8: https://dev.mysql.com/doc/refman/8.0/en/json.html https://dev.mysql.com/doc/refman/8.0/en/json.html MariaDB does not have a JSON column type, instead aliasing it to LONGTEXT. MariaDB takes an alternative approach of providing JSON manipulation functions which work with stringy types. https://mariadb.com/kb/en/json-data-type/ https://mariadb.com/kb/en/json-data-type/ Note that in some Linux distributions, when you try to install "mysql" packages you instead get "mariadb", so you may need to query the server to see which one it really is!
- linsomniac 5y agoThis was in Maria, thanks for clearing that up. I thought I had mentioned MariaDB but I guess that was another response, sorry for that confusion.