Now that MySQL supports the JSON data type:
https://dev.mysql.com/doc/refman/5.7/en/json.html
It would be nice if HS supported that when creating a table, and when displaying the data.
Add JSON Data Type
Also the ability to add secondary indexes on virtual columns when creating a table:
https://dev.mysql.com/doc/refman/5.7/en/create-table.html#create-table-secondary-indexes-virtual-columns
https://dev.mysql.com/doc/refman/5.7/en/create-table.html#create-table-secondary-indexes-virtual-columns
Also when updating items they are handled as strings as well. While testing I noticed that HS doesn't handle them as strings (so that would need to be changed also).
It attempted to do this (throws a mysql error):
when it should have done this (note the apostrophes around the json):
It attempted to do this (throws a mysql error):
update table set c={"one":"1","two"2} where id=1;
when it should have done this (note the apostrophes around the json):
update table set c='{"one":"1","two"2}' where id=1;
Code modification/commit
cbbfcb2
from ansgarbecker,
9 years ago,
revision 9.3.0.5010
Add basic support for MySQL's new JSON data type. See http://www.heidisql.com/forum.php?t=19870
When I run the command show create table xxx; this is displayed:
When I view through the tab in HeidiSQL, I get this:
Is HeidiSQL re-writing it or is syntax highlighting removing it because of the keywords?
CREATE TABLE `jemp` (
`c` json DEFAULT NULL,
`g` int(11) GENERATED ALWAYS AS (JSON_EXTRACT(c, '$.id')) VIRTUAL,
KEY `i` (`g`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
When I view through the tab in HeidiSQL, I get this:
CREATE TABLE `jemp` (
`c` JSON NULL DEFAULT NULL,
`g` INT(11) AS (JSON_EXTRACT(c, '$.id')) VIRTUAL,
INDEX `i` (`g`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
Is HeidiSQL re-writing it or is syntax highlighting removing it because of the keywords?
Please login to leave a reply, or register at first.