This commit is contained in:
dni ⚡
2024-10-10 09:07:40 +02:00
parent c0db3468af
commit cfdd81d37e
+4 -2
View File
@@ -175,7 +175,9 @@ class Connection(Compat):
return dict_to_model(row, model)
return row
async def update(self, table_name: str, model: BaseModel, where: str = "id = :id"):
async def update(
self, table_name: str, model: BaseModel, where: str = "WHERE id = :id"
):
await self.conn.execute(
text(update_query(table_name, model, where)), model_to_dict(model)
)
@@ -341,7 +343,7 @@ class Database(Compat):
await conn.insert(table_name, model)
async def update(
self, table_name: str, model: BaseModel, where: str = "id = :id"
self, table_name: str, model: BaseModel, where: str = "WHERE id = :id"
) -> None:
async with self.connect() as conn:
await conn.update(table_name, model, where)