MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / execute

Method execute

__tests__/telemetry-services.test.ts:55–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 execute(): { success: true; results: Row[]; meta: { changes: number } } {
56 this.d1.onStatement?.(this.sql);
57 const stmt = this.d1.db.prepare(this.sql);
58 const params = this.params.map(bindable) as never[];
59 if (/^\s*(SELECT|WITH)\b/i.test(this.sql)) {
60 return { success: true, results: stmt.all(...params) as Row[], meta: { changes: 0 } };
61 }
62 const info = stmt.run(...params);
63 return { success: true, results: [], meta: { changes: Number(info.changes) } };
64 }
65
66 async first<T>(): Promise<T | null> {
67 return (this.execute().results[0] as T | undefined) ?? null;

Callers 15

firstMethod · 0.95
allMethod · 0.95
runMethod · 0.95
exploreFunction · 0.45
exploreFunction · 0.45

Calls 5

NumberInterface · 0.85
mapMethod · 0.80
prepareMethod · 0.65
allMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected