(db: DatabaseAdapter)
| 105 | * Get the latest platform_message_id (used as incremental import boundary). |
| 106 | */ |
| 107 | export function getLastPlatformMessageId(db: DatabaseAdapter): string | null { |
| 108 | const row = db |
| 109 | .prepare('SELECT platform_message_id FROM message WHERE platform_message_id IS NOT NULL ORDER BY ts DESC LIMIT 1') |
| 110 | .get() as { platform_message_id: string } | undefined |
| 111 | return row?.platform_message_id ?? null |
| 112 | } |
| 113 | |
| 114 | // ==================== Core identification ==================== |
| 115 |
no test coverage detected