holistics/dbml

mysql import fails to escape trailing singlequotes in column comments

Opened this issue · 0 comments

Consider the following mysql:

CREATE TABLE `curation_sample` (
  `sample_size` double DEFAULT NULL COMMENT 'The size of the sample in unit ''sample size unit'''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='GENERATED:2024-05-02 20:28:51;';

sql2dbml outputs the following DBML document for this:

Table "curation_sample" {
  "sample_size" double [default: NULL, note: '''The size of the sample in unit ''sample size unit''''']
  Note: 'GENERATED:2024-05-02 20:28:51;'
}

The string ends with five single-quotes so it is not parsed correctly by a conformant DBML consumer.