fixup!
This commit is contained in:
+4
-2
@@ -175,7 +175,9 @@ class Connection(Compat):
|
|||||||
return dict_to_model(row, model)
|
return dict_to_model(row, model)
|
||||||
return row
|
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(
|
await self.conn.execute(
|
||||||
text(update_query(table_name, model, where)), model_to_dict(model)
|
text(update_query(table_name, model, where)), model_to_dict(model)
|
||||||
)
|
)
|
||||||
@@ -341,7 +343,7 @@ class Database(Compat):
|
|||||||
await conn.insert(table_name, model)
|
await conn.insert(table_name, model)
|
||||||
|
|
||||||
async def update(
|
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:
|
) -> None:
|
||||||
async with self.connect() as conn:
|
async with self.connect() as conn:
|
||||||
await conn.update(table_name, model, where)
|
await conn.update(table_name, model, where)
|
||||||
|
|||||||
Reference in New Issue
Block a user