From a93973af06dde27e17a477a84d0e090ccc6b05fb Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Fri, 17 Oct 2025 13:02:28 +0800 Subject: [PATCH] Fix the import table cli command (#860) --- backend/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/cli.py b/backend/cli.py index d77ea35d..27b80308 100644 --- a/backend/cli.py +++ b/backend/cli.py @@ -145,7 +145,8 @@ async def import_table( ) -> None: try: obj = ImportParam(app=app, table_schema=table_schema, table_name=table_name) - await gen_service.import_business_and_model(obj=obj) + async with async_db_session.begin() as db: + await gen_service.import_business_and_model(db=db, obj=obj) except Exception as e: raise cappa.Exit(e.msg if isinstance(e, BaseExceptionError) else str(e), code=1)