MCPcopy Index your code
hub / github.com/CapSoftware/Cap / splitSchema

Function splitSchema

scripts/analytics/check-analytics.js:24–40  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

22 buildSchemaLines(table).map((column) => normalizeColumnDef(column));
23
24const splitSchema = (schema) => {
25 const parts = [];
26 let depth = 0;
27 let current = "";
28 for (const char of schema) {
29 if (char === "(") depth += 1;
30 if (char === ")" && depth > 0) depth -= 1;
31 if (char === "," && depth === 0) {
32 if (current.trim()) parts.push(current.trim());
33 current = "";
34 continue;
35 }
36 current += char;
37 }
38 if (current.trim()) parts.push(current.trim());
39 return parts;
40};
41
42async function validateTables(client) {
43 const issues = [];

Callers 1

validateTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected