export async function formatSqlSnapshotForSave(sqlSnapshot: string, currentSql: () => string, format: (sql: string) => Promise, applyFormatted: (sql: string) => void): Promise { const formatted = await format(sqlSnapshot); if (currentSql() !== sqlSnapshot) return currentSql(); if (formatted !== sqlSnapshot) applyFormatted(formatted); return formatted; }