MCPcopy
hub / github.com/drawdb-io/drawdb / parseType

Function parseType

src/utils/exportSQL/mysql.js:11–26  ·  view source on GitHub ↗
(field)

Source from the content-addressed store, hash-verified

9import { DB } from "../../data/constants";
10
11function parseType(field) {
12 let res = field.type;
13
14 if (field.type === "SET" || field.type === "ENUM") {
15 res += `${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}`;
16 }
17
18 if (
19 dbToTypes[DB.MYSQL][field.type].isSized ||
20 dbToTypes[DB.MYSQL][field.type].hasPrecision
21 ) {
22 res += `${field.size && field.size !== "" ? "(" + field.size + ")" : ""}`;
23 }
24
25 return res;
26}
27
28export function toMySQL(diagram) {
29 return `${diagram.tables

Callers 1

toMySQLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected