Skip to content

Commit a93973a

Browse files
authored
Fix the import table cli command (#860)
1 parent 15a9527 commit a93973a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ async def import_table(
145145
) -> None:
146146
try:
147147
obj = ImportParam(app=app, table_schema=table_schema, table_name=table_name)
148-
await gen_service.import_business_and_model(obj=obj)
148+
async with async_db_session.begin() as db:
149+
await gen_service.import_business_and_model(db=db, obj=obj)
149150
except Exception as e:
150151
raise cappa.Exit(e.msg if isinstance(e, BaseExceptionError) else str(e), code=1)
151152

0 commit comments

Comments
 (0)