mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-01-17 11:40:39 +03:00
add json filed example
This commit is contained in:
@@ -27,7 +27,8 @@ class Base(DeclarativeBase):
|
||||
"""
|
||||
try:
|
||||
db_session.add(self)
|
||||
return await db_session.commit()
|
||||
await db_session.commit()
|
||||
return await db_session.refresh(self)
|
||||
except SQLAlchemyError as ex:
|
||||
await logger.aerror(f"Error inserting instance of {self}: {repr(ex)}")
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user