( adapter: DatabaseAdapter, tableName: string, )
| 53 | } |
| 54 | |
| 55 | export async function loadJournalRows( |
| 56 | adapter: DatabaseAdapter, |
| 57 | tableName: string, |
| 58 | ): Promise<MigrationJournalRow[]> { |
| 59 | let result = await adapter.execute({ |
| 60 | operation: { |
| 61 | kind: 'raw', |
| 62 | sql: rawSql( |
| 63 | 'select id, name, checksum, batch, applied_at from ' + tableName + ' order by id asc', |
| 64 | ), |
| 65 | }, |
| 66 | }) |
| 67 | |
| 68 | let rows = result.rows ?? [] |
| 69 | |
| 70 | return rows.map((row) => ({ |
| 71 | id: String(row.id), |
| 72 | name: String(row.name), |
| 73 | checksum: String(row.checksum), |
| 74 | batch: Number(row.batch), |
| 75 | appliedAt: new Date(String(row.applied_at)), |
| 76 | })) |
| 77 | } |
| 78 | |
| 79 | export async function insertJournalRow( |
| 80 | adapter: DatabaseAdapter, |
no test coverage detected
searching dependent graphs…