Skip to content

Commit 5727c62

Browse files
authored
Add table comment on import in mariadb and mysql (#411)
1 parent 4de49cb commit 5727c62

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/utils/importSQL/mariadb.js

+7
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
161161
}
162162
}
163163
});
164+
165+
e.table_options.forEach((opt) => {
166+
if (opt.keyword === "comment") {
167+
table.comment = opt.value.replace(/^["']|["']$/g, "");
168+
}
169+
});
170+
164171
table.fields.forEach((f, j) => {
165172
f.id = j;
166173
});

src/utils/importSQL/mysql.js

+7
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
161161
}
162162
}
163163
});
164+
165+
e.table_options.forEach((opt) => {
166+
if (opt.keyword === "comment") {
167+
table.comment = opt.value.replace(/^["']|["']$/g, '');
168+
}
169+
});
170+
164171
table.fields.forEach((f, j) => {
165172
f.id = j;
166173
});

0 commit comments

Comments
 (0)