fix: quickstart fails on Windows — missing DATABASE_STRING (#5719)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Suchintan 2026-04-29 19:59:52 -07:00 committed by GitHub
parent ada83abe7c
commit 8b203899e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 12 deletions

View file

@ -81,25 +81,20 @@ async def run_migrations_online():
await connectable.dispose()
print("Alembic mode: ", "offline" if context.is_offline_mode() else "online")
if context.is_offline_mode():
run_migrations_offline()
else:
async def async_main():
await run_migrations_online()
try:
loop = asyncio.get_running_loop()
except RuntimeError:
# No running loop -> safe to start one
print("Alembic: no running loop")
asyncio.run(async_main())
else:
# Already running loop -> schedule task and await it
print("Alembic: schedule task")
import concurrent.futures
# Use a ThreadPoolExecutor to run the async function in a new thread
with concurrent.futures.ThreadPoolExecutor() as executor:
future = executor.submit(asyncio.run, async_main())
future.result() # This blocks until completion
future.result()