MCPcopy Create free account
hub / github.com/drawdb-io/drawdb / parseType

Function parseType

src/utils/migrations/diffToSQL.js:18–29  ·  view source on GitHub ↗
(field, db)

Source from the content-addressed store, hash-verified

16}
17
18function parseType(field, db) {
19 let res = field.type;
20 const meta = dbToTypes[db]?.[field.type];
21 if (field.type === "SET" || field.type === "ENUM") {
22 res += field.values
23 ? `(${field.values.map((v) => `'${v}'`).join(", ")})`
24 : "";
25 } else if (meta?.isSized || meta?.hasPrecision) {
26 res += field.size ? `(${field.size})` : "";
27 }
28 return res;
29}
30
31function columnDefinition(field, db) {
32 const meta =

Callers 2

columnDefinitionFunction · 0.70
toTableFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected