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

Method trigger

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

Source from the content-addressed store, hash-verified

207 }
208
209 async trigger(
210 schemaName: string,
211 name: string
212 ): Promise<DatabaseTriggerSchema> {
213 const result = await this.query(
214 `SELECT * FROM ${this.escapeId(schemaName)}.sqlite_schema WHERE "type"='trigger' AND name=${escapeSqlValue(
215 name
216 )};`
217 );
218
219 const triggerRow = result.rows[0] as { sql: string } | undefined;
220 if (!triggerRow) throw new Error("Trigger does not exist");
221
222 return parseCreateTriggerScript(schemaName, triggerRow.sql);
223 }
224
225 close(): void {
226 // do nothing

Callers

nothing calls this directly

Calls 4

queryMethod · 0.95
escapeIdMethod · 0.95
escapeSqlValueFunction · 0.90
parseCreateTriggerScriptFunction · 0.90

Tested by

no test coverage detected