Future<T> withWrite<T>(String table, Future<T> Function() fn) async { final grant = await acquireWrite(table); try { return await fn(); } finally { release(grant); } }