(db: D1Database, table: string)
| 47 | }; |
| 48 | |
| 49 | const 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 | |
| 61 | const rebuildLegacyConnectionTable = async (db: D1Database): Promise<void> => { |
| 62 | const statements = [ |
no outgoing calls
no test coverage detected