MCPcopy Index your code
hub / github.com/outerbase/studio / getSchemaList

Method getSchemaList

src/drivers/sqlite-base-driver.ts:99–136  ·  view source on GitHub ↗
(
    result: DatabaseResultSet,
    schemaName: string
  )

Source from the content-addressed store, hash-verified

97 }
98
99 protected getSchemaList(
100 result: DatabaseResultSet,
101 schemaName: string
102 ): DatabaseSchemaItem[] {
103 const tmp: DatabaseSchemaItem[] = [];
104 const rows = result.rows as Array<{
105 type: string;
106 name: string;
107 tbl_name: string;
108 sql: string;
109 }>;
110
111 for (const row of rows) {
112 if (row.type === "table") {
113 try {
114 tmp.push({
115 type: "table",
116 schemaName,
117 name: row.name,
118 tableSchema: parseCreateTableScript(schemaName, row.sql),
119 });
120 } catch {
121 tmp.push({ type: "table", name: row.name, schemaName });
122 }
123 } else if (row.type === "trigger") {
124 tmp.push({
125 type: "trigger",
126 name: row.name,
127 tableName: row.tbl_name,
128 schemaName,
129 });
130 } else if (row.type === "view") {
131 tmp.push({ type: "view", name: row.name, schemaName });
132 }
133 }
134
135 return tmp;
136 }
137
138 protected async legacyTableSchema(
139 schemaName: string,

Callers 1

schemasMethod · 0.95

Calls 1

parseCreateTableScriptFunction · 0.90

Tested by

no test coverage detected