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

Method view

src/drivers/sqlite-base-driver.ts:284–292  ·  view source on GitHub ↗
(schemaName: string, name: string)

Source from the content-addressed store, hash-verified

282 }
283
284 async view(schemaName: string, name: string): Promise<DatabaseViewSchema> {
285 const sql = `SELECT * FROM ${this.escapeId(schemaName)}.sqlite_schema WHERE type = 'view' AND name = ${this.escapeValue(name)};`;
286 const result = await this.query(sql);
287
288 const viewRow = result.rows[0] as { sql: string } | undefined;
289 if (!viewRow) throw new Error("View dose not exist");
290
291 return parseCreateViewScript(schemaName, viewRow.sql);
292 }
293
294 createView(view: DatabaseViewSchema): string {
295 return `CREATE VIEW ${this.escapeId(view.schemaName)}.${this.escapeId(view.name)} AS ${view.statement}`;

Callers

nothing calls this directly

Calls 4

escapeIdMethod · 0.95
escapeValueMethod · 0.95
queryMethod · 0.95
parseCreateViewScriptFunction · 0.90

Tested by

no test coverage detected