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

Function generateSchema

src/utils/exportSQL/generic.js:41–47  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

39}
40
41export function generateSchema(type) {
42 return `{\n\t\t\t"$schema": "http://json-schema.org/draft-04/schema#",\n\t\t\t"type": "object",\n\t\t\t"properties": {\n\t\t\t\t${type.fields
43 .map((f) => `"${f.name}" : ${getJsonType(f)}`)
44 .join(
45 ",\n\t\t\t\t",
46 )}\n\t\t\t},\n\t\t\t"additionalProperties": false\n\t\t}`;
47}
48
49export function getTypeString(
50 field,

Callers 2

jsonToMySQLFunction · 0.85
jsonToMariaDBFunction · 0.85

Calls 1

getJsonTypeFunction · 0.85

Tested by

no test coverage detected