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

Function columnNames

apps/local/src/db/v1-v2-migration.ts:145–150  ·  view source on GitHub ↗
(client: Client, table: string)

Source from the content-addressed store, hash-verified

143 ])) != null;
144
145const columnNames = async (client: Client, table: string): Promise<ReadonlySet<string>> =>
146 new Set(
147 (await queryRows<{ name: string }>(client, `PRAGMA table_info(${quoteIdent(table)})`)).map(
148 (row) => row.name,
149 ),
150 );
151
152const optionalColumn = (columns: ReadonlySet<string>, table: string, column: string): string =>
153 columns.has(column) ? `${quoteIdent(table)}.${quoteIdent(column)}` : "NULL";

Callers 2

isLocalV1DatabaseFunction · 0.70
readV1SnapshotFunction · 0.70

Calls 1

quoteIdentFunction · 0.70

Tested by

no test coverage detected