MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / tableColumns

Function tableColumns

apps/host-cloudflare/src/db/data-migrations.ts:49–59  ·  view source on GitHub ↗
(db: D1Database, table: string)

Source from the content-addressed store, hash-verified

47};
48
49const tableColumns = async (db: D1Database, table: string): Promise<ReadonlySet<string>> => {
50 const session = db.withSession("first-primary");
51 const result = await session.prepare(`PRAGMA table_info('${table}')`).all<{
52 readonly name?: unknown;
53 }>();
54 return new Set(
55 result.results
56 .map((row) => row.name)
57 .filter((name): name is string => typeof name === "string"),
58 );
59};
60
61const rebuildLegacyConnectionTable = async (db: D1Database): Promise<void> => {
62 const statements = [

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected