You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): enhance async handling for migration commands (#274)
Improve the handling of synchronous and asynchronous database adapters in CLI commands. Implement a pattern to execute sync and async operations separately, ensuring compatibility and efficiency when processing migration commands.
- Use `wrap_exceptions` context manager in adapter layer
416
416
- Two-tier pattern: graceful skip (DEBUG) for expected conditions, hard errors for malformed input
417
417
418
+
### CLI Sync/Async Dispatch Pattern
419
+
420
+
When implementing CLI commands that support both sync and async database adapters:
421
+
422
+
**Problem:** Sync adapters (SQLite, DuckDB, BigQuery, ADBC, Spanner sync, Psycopg sync, Oracle sync) fail with `await_ cannot be called from within an async task` if wrapped in an event loop.
423
+
424
+
**Solution:** Partition configs and execute sync/async batches separately:
0 commit comments