JSON Data Type
Complete JSON Data Type data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
Examples
CREATE TABLE t (j JSON);
DESC t;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| j | longtext | YES | | NULL | |
+-------+----------+------+-----+---------+-------+CREATE TABLE t2 (
j JSON
CHECK (JSON_VALID(j))
);
INSERT INTO t2 VALUES ('invalid');
ERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`
INSERT INTO t2 VALUES ('{"id": 1, "name": "Monty"}');
Query OK, 1 row affected (0.13 sec)Replicating JSON Data Between MySQL and MariaDB
Converting a MySQL TABLE with JSON Fields to MariaDB
Differences Between MySQL JSON Strings and MariaDB JSON Strings
See Also
Last updated
Was this helpful?

